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
May 2008
----- 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
25 participants
586 discussions
Start a n
N
ew thread
[greatlrd] 33700: fix right export prefix for LpkPresent.
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun May 25 12:51:15 2008 New Revision: 33700 URL:
http://svn.reactos.org/svn/reactos?rev=33700&view=rev
Log: fix right export prefix for LpkPresent. Modified: trunk/reactos/dll/win32/usp10/usp10.c trunk/reactos/dll/win32/usp10/usp10.spec Modified: trunk/reactos/dll/win32/usp10/usp10.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/usp10/usp10.c?re…
============================================================================== --- trunk/reactos/dll/win32/usp10/usp10.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/usp10/usp10.c [iso-8859-1] Sun May 25 12:51:15 2008 @@ -1731,3 +1731,11 @@ for (i = 0; i < nbchars; i++) widths[i] = glyph_width[i]; return S_OK; } + + +VOID WINAPI LpkPresent() +{ + /* FIXME */ + DbgPrint("LPK: %s is unimplemented, please try again later.\n", __FUNCTION__); +} + Modified: trunk/reactos/dll/win32/usp10/usp10.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/usp10/usp10.spec…
============================================================================== --- trunk/reactos/dll/win32/usp10/usp10.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/usp10/usp10.spec [iso-8859-1] Sun May 25 12:51:15 2008 @@ -1,4 +1,4 @@ -@ stub LpkPresent +@ stdcall LpkPresent() @ stdcall ScriptApplyDigitSubstitution(ptr ptr ptr) @ stub ScriptApplyLogicalWidth @ stdcall ScriptBreak(ptr long ptr ptr)
16 years, 5 months
1
0
0
0
[greatlrd] 33699: add dll lpk it is stub for now. it will be use of gdi32 and user32 later
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun May 25 10:22:09 2008 New Revision: 33699 URL:
http://svn.reactos.org/svn/reactos?rev=33699&view=rev
Log: add dll lpk it is stub for now. it will be use of gdi32 and user32 later Added: trunk/reactos/dll/win32/lpk/ trunk/reactos/dll/win32/lpk/dllmain.c (with props) trunk/reactos/dll/win32/lpk/lpk.def (with props) trunk/reactos/dll/win32/lpk/lpk.rbuild (with props) trunk/reactos/dll/win32/lpk/lpk.rc (with props) trunk/reactos/dll/win32/lpk/ros_lpk.h (with props) trunk/reactos/dll/win32/lpk/stub.c (with props) Modified: trunk/reactos/baseaddress.rbuild trunk/reactos/dll/win32/win32.rbuild Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=336…
============================================================================== --- trunk/reactos/baseaddress.rbuild [iso-8859-1] (original) +++ trunk/reactos/baseaddress.rbuild [iso-8859-1] Sun May 25 10:22:09 2008 @@ -7,6 +7,7 @@ <property name="BASEADDRESS_DEVENUM" value="0x35680000" /> <property name="BASEADDRESS_RSABASE" value="0x35700000" /> <property name="BASEADDRESS_RSAENH" value="0x35780000" /> + <property name="BASEADDRESS_LPK" value="0x516C0000" /> <property name="BASEADDRESS_TELEPHON" value="0x58750000" /> <property name="BASEADDRESS_PWRCFG" value="0x587e0000" /> <property name="BASEADDRESS_MMSYS" value="0x588a0000" /> Added: trunk/reactos/dll/win32/lpk/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lpk/dllmain.c?re…
============================================================================== --- trunk/reactos/dll/win32/lpk/dllmain.c (added) +++ trunk/reactos/dll/win32/lpk/dllmain.c [iso-8859-1] Sun May 25 10:22:09 2008 @@ -1,0 +1,35 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS + * PURPOSE: LPK Library + * PROGRAMMER: Magnus Olsen (greatlrd) + * + */ + +#include "ros_lpk.h" + +LPK_LPEDITCONTROL_LIST LpkEditControl = {EditCreate, EditIchToXY, EditMouseToIch, EditCchInWidth, + EditGetLineWidth, EditDrawText, EditHScroll, EditMoveSelection, + EditVerifyText, EditNextWord, EditSetMenu, EditProcessMenu, + EditCreateCaret, EditAdjustCaret}; + +BOOL +WINAPI +DllMain ( + HANDLE hDll, + DWORD dwReason, + LPVOID lpReserved) +{ + + return TRUE; +} + +BOOL +WINAPI +LpkDllInitialize ( + HANDLE hDll, + DWORD dwReason, + LPVOID lpReserved) +{ + return DllMain(hDll,dwReason,lpReserved); +} Propchange: trunk/reactos/dll/win32/lpk/dllmain.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/lpk/lpk.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lpk/lpk.def?rev=…
============================================================================== --- trunk/reactos/dll/win32/lpk/lpk.def (added) +++ trunk/reactos/dll/win32/lpk/lpk.def [iso-8859-1] Sun May 25 10:22:09 2008 @@ -1,0 +1,20 @@ +; $Id: gdi32.def 33598 2008-05-19 10:20:39Z greatlrd $ +; +; lpk.def +; +; ReactOS Operating System +; +LIBRARY lpk.dll +EXPORTS +LpkInitialize@4 +LpkTabbedTextOut@48 +LpkDllInitialize@12 +LpkDrawTextEx@40 +LpkEditControl@0 +LpkExtTextOut@36 +LpkGetCharacterPlacement@28 +LpkGetTextExtentExPoint@36 +LpkPSMTextOut@24 +LpkUseGDIWidthCache@20 +ftsWordBreak@20 + Propchange: trunk/reactos/dll/win32/lpk/lpk.def ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/lpk/lpk.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lpk/lpk.rbuild?r…
============================================================================== --- trunk/reactos/dll/win32/lpk/lpk.rbuild (added) +++ trunk/reactos/dll/win32/lpk/lpk.rbuild [iso-8859-1] Sun May 25 10:22:09 2008 @@ -1,0 +1,20 @@ +<module name="lpk" type="win32dll" baseaddress="${BASEADDRESS_LPK}" installbase="system32" installname="lpk.dll" unicode="yes"> + <importlibrary definition="lpk.def" /> + <include base="lpk">include</include> + <define name="_DISABLE_TIDENTS" /> + <define name="WINVER">0x0600</define> + <define name="_WIN32_WINNT">0x0501</define> + <define name="LANGPACK" /> + <library>ntdll</library> + <library>kernel32</library> + <library>user32</library> + <library>usp10</library> + + <file>dllmain.c</file> + <file>stub.c</file> + + <linkerflag>-lgcc</linkerflag> + <linkerflag>-nostartfiles</linkerflag> + <linkerflag>-nostdlib</linkerflag> + <file>lpk.rc</file> +</module> Propchange: trunk/reactos/dll/win32/lpk/lpk.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/lpk/lpk.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lpk/lpk.rc?rev=3…
============================================================================== --- trunk/reactos/dll/win32/lpk/lpk.rc (added) +++ trunk/reactos/dll/win32/lpk/lpk.rc [iso-8859-1] Sun May 25 10:22:09 2008 @@ -1,0 +1,5 @@ +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "Language Pack\0" +#define REACTOS_STR_INTERNAL_NAME "lpk\0" +#define REACTOS_STR_ORIGINAL_FILENAME "lpk.dll\0" +#include <reactos/version.rc> Propchange: trunk/reactos/dll/win32/lpk/lpk.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/lpk/ros_lpk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lpk/ros_lpk.h?re…
============================================================================== --- trunk/reactos/dll/win32/lpk/ros_lpk.h (added) +++ trunk/reactos/dll/win32/lpk/ros_lpk.h [iso-8859-1] Sun May 25 10:22:09 2008 @@ -1,0 +1,63 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS + * PURPOSE: LPK Library + * PROGRAMMER: Magnus Olsen (greatlrd) + * + */ +#define WIN32_NO_STATUS +#define NTOS_MODE_USER + +#include <windows.h> +#include <ndk/ntndk.h> + +/* FIXME move _LPK_LPEDITCONTROL_LIST to global place so user32 can access it */ +typedef struct _LPK_LPEDITCONTROL_LIST +{ + PVOID EditCreate; + PVOID EditIchToXY; + PVOID EditMouseToIch; + PVOID EditCchInWidth; + PVOID EditGetLineWidth; + PVOID EditDrawText; + PVOID EditHScroll; + PVOID EditMoveSelection; + PVOID EditVerifyText; + PVOID EditNextWord; + PVOID EditSetMenu; + PVOID EditProcessMenu; + PVOID EditCreateCaret; + PVOID EditAdjustCaret; +} LPK_LPEDITCONTROL_LIST, *PLPK_LPEDITCONTROL_LIST; + +/* This List are exported */ + + +DWORD WINAPI EditCreate( DWORD x1, DWORD x2); +DWORD WINAPI EditIchToXY( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5); +DWORD WINAPI EditMouseToIch( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5); +DWORD WINAPI EditCchInWidth( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5); + +DWORD WINAPI EditGetLineWidth( DWORD x1, DWORD x2, DWORD x3, DWORD x4); +DWORD WINAPI EditDrawText( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5, DWORD x6, DWORD x7); +DWORD WINAPI EditHScroll( DWORD x1, DWORD x2, DWORD x3); +DWORD WINAPI EditMoveSelection( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5); + +DWORD WINAPI EditVerifyText( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5, DWORD x6); +DWORD WINAPI EditNextWord(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5, DWORD x6, DWORD x7); +DWORD WINAPI EditSetMenu(DWORD x1, DWORD x2); +DWORD WINAPI EditProcessMenu(DWORD x1, DWORD x2); +DWORD WINAPI EditCreateCaret(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5); +DWORD WINAPI EditAdjustCaret(DWORD x1, DWORD x2, DWORD x3, DWORD x5); + +DWORD WINAPI LpkInitialize(DWORD x1); +DWORD WINAPI LpkTabbedTextOut(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8,DWORD x9,DWORD x10,DWORD x11,DWORD x12); +BOOL WINAPI LpkDllInitialize (HANDLE hDll, DWORD dwReason, LPVOID lpReserved); +DWORD WINAPI LpkDrawTextEx(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8,DWORD x9, DWORD x10); +DWORD WINAPI LpkExtTextOut(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8,DWORD x9); +DWORD WINAPI LpkGetCharacterPlacement(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6, DWORD x7); +DWORD WINAPI LpkGetTextExtentExPoint(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8,DWORD x9); +DWORD WINAPI LpkPSMTextOut(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6); +DWORD WINAPI LpkUseGDIWidthCache(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5); +DWORD WINAPI ftsWordBreak(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5); + Propchange: trunk/reactos/dll/win32/lpk/ros_lpk.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/lpk/stub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lpk/stub.c?rev=3…
============================================================================== --- trunk/reactos/dll/win32/lpk/stub.c (added) +++ trunk/reactos/dll/win32/lpk/stub.c [iso-8859-1] Sun May 25 10:22:09 2008 @@ -1,0 +1,178 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS + * PURPOSE: LPK Library + * PROGRAMMER: Magnus Olsen (greatlrd) + * + */ + +#include "ros_lpk.h" + +#define UNIMPLEMENTED DbgPrint("LPK: %s is unimplemented, please try again later.\n", __FUNCTION__); + +/* + * @unimplemented + */ +DWORD WINAPI LpkInitialize(DWORD x1) +{ + UNIMPLEMENTED + return 0; +} + +/* + * @unimplemented + */ +DWORD WINAPI LpkTabbedTextOut(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8,DWORD x9,DWORD x10,DWORD x11,DWORD x12) +{ + UNIMPLEMENTED + return 0; +} + +/* + * @unimplemented + */ +DWORD WINAPI LpkDrawTextEx(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8,DWORD x9, DWORD x10) +{ + UNIMPLEMENTED + return 0; +} + +/* + * @unimplemented + */ +DWORD WINAPI LpkExtTextOut(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8,DWORD x9) +{ + UNIMPLEMENTED + return 0; +} + +/* + * @unimplemented + */ +DWORD WINAPI LpkGetCharacterPlacement(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6, DWORD x7) +{ + UNIMPLEMENTED + return 0; +} + +/* + * @unimplemented + */ +DWORD WINAPI LpkGetTextExtentExPoint(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD x7,DWORD x8,DWORD x9) +{ + UNIMPLEMENTED + return 0; +} + +/* + * @unimplemented + */ +DWORD WINAPI LpkPSMTextOut(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6) +{ + UNIMPLEMENTED + return 0; +} + +/* + * @unimplemented + */ +DWORD WINAPI LpkUseGDIWidthCache(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) +{ + UNIMPLEMENTED + return 0; +} + +/* + * @unimplemented + */ +DWORD WINAPI ftsWordBreak(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditCreate( DWORD x1, DWORD x2) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditIchToXY( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditMouseToIch( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditCchInWidth( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5) +{ + UNIMPLEMENTED + return 0; +} + + +DWORD WINAPI EditGetLineWidth( DWORD x1, DWORD x2, DWORD x3, DWORD x4) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditDrawText( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5, DWORD x6, DWORD x7) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditHScroll( DWORD x1, DWORD x2, DWORD x3) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditMoveSelection( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditVerifyText( DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5, DWORD x6) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditNextWord(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5, DWORD x6, DWORD x7) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditSetMenu(DWORD x1, DWORD x2) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditProcessMenu(DWORD x1, DWORD x2) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditCreateCaret(DWORD x1, DWORD x2, DWORD x3, DWORD x4, DWORD x5) +{ + UNIMPLEMENTED + return 0; +} + +DWORD WINAPI EditAdjustCaret(DWORD x1, DWORD x2, DWORD x3, DWORD x5) +{ + UNIMPLEMENTED + return 0; +} + Propchange: trunk/reactos/dll/win32/lpk/stub.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
============================================================================== --- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Sun May 25 10:22:09 2008 @@ -121,6 +121,9 @@ <directory name="kernel32"> <xi:include href="kernel32/kernel32.rbuild" /> </directory> +<directory name="lpk"> + <xi:include href="lpk/lpk.rbuild" /> +</directory> <directory name="lsasrv"> <xi:include href="lsasrv/lsasrv.rbuild" /> </directory>
16 years, 5 months
1
0
0
0
[cfinck] 33698: Update README.WINE about the crypt32 sync
by cfinck@svn.reactos.org
Author: cfinck Date: Sun May 25 09:16:14 2008 New Revision: 33698 URL:
http://svn.reactos.org/svn/reactos?rev=33698&view=rev
Log: Update README.WINE about the crypt32 sync Modified: trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun May 25 09:16:14 2008 @@ -40,7 +40,7 @@ reactos/dll/win32/comctl32 # Autosync reactos/dll/win32/comdlg32 # Autosync reactos/dll/win32/compstui # Autosync -reactos/dll/win32/crypt32 # Out of sync +reactos/dll/win32/crypt32 # Synced to Wine-1_0-rc1 reactos/dll/win32/cryptdll # Autosync reactos/dll/win32/cryptnet # Autosync reactos/dll/win32/dbghelp # Synced to Wine-20080106
16 years, 5 months
1
0
0
0
[greatlrd] 33697: started added test for InitializeLpkHooks this tests are not completed more will follow. this is the frame work for testing InitializeLpkHooks
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun May 25 07:04:06 2008 New Revision: 33697 URL:
http://svn.reactos.org/svn/reactos?rev=33697&view=rev
Log: started added test for InitializeLpkHooks this tests are not completed more will follow. this is the frame work for testing InitializeLpkHooks Added: trunk/rostests/apitests/user32api/tests/InitializeLpkHooks.c (with props) Modified: trunk/rostests/apitests/user32api/testlist.c Modified: trunk/rostests/apitests/user32api/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32api/testli…
============================================================================== --- trunk/rostests/apitests/user32api/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32api/testlist.c [iso-8859-1] Sun May 25 07:04:06 2008 @@ -6,6 +6,7 @@ #include "user32api.h" /* include the tests */ +#include "tests/InitializeLpkHooks.c" #include "tests/ScrollDC.c" #include "tests/ScrollWindowEx.c" #include "tests/RealGetWindowClass.c" @@ -13,6 +14,7 @@ /* The List of tests */ TESTENTRY TestList[] = { + { L"InitializeLpkHooks", Test_InitializeLpkHooks }, { L"ScrollDC", Test_ScrollDC }, { L"ScrollWindowEx", Test_ScrollWindowEx }, { L"RealGetWindowClass", Test_RealGetWindowClass }, Added: trunk/rostests/apitests/user32api/tests/InitializeLpkHooks.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32api/tests/…
============================================================================== --- trunk/rostests/apitests/user32api/tests/InitializeLpkHooks.c (added) +++ trunk/rostests/apitests/user32api/tests/InitializeLpkHooks.c [iso-8859-1] Sun May 25 07:04:06 2008 @@ -1,0 +1,96 @@ + +typedef struct _LPK_LPEDITCONTROL_LIST +{ + PVOID EditCreate; + PVOID EditIchToXY; + PVOID EditMouseToIch; + PVOID EditCchInWidth; + PVOID EditGetLineWidth; + PVOID EditDrawText; + PVOID EditHScroll; + PVOID EditMoveSelection; + PVOID EditVerifyText; + PVOID EditNextWord; + PVOID EditSetMenu; + PVOID EditProcessMenu; + PVOID EditCreateCaret; + PVOID EditAdjustCaret; +} LPK_LPEDITCONTROL_LIST, *PLPK_LPEDITCONTROL_LIST; + + +DWORD (APIENTRY *fpLpkTabbedTextOut) (LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID); +DWORD (APIENTRY *fpLpkPSMTextOut) (LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID); +DWORD (APIENTRY *fpLpkDrawTextEx) (LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID); +PLPK_LPEDITCONTROL_LIST (APIENTRY *fpLpkEditControl) (); + +int Count_myLpkTabbedTextOut = 0; +int Count_myLpkPSMTextOut = 0; +int Count_myLpkDrawTextEx = 0; + +DWORD STDCALL myLpkTabbedTextOut (LPVOID x1,LPVOID x2,LPVOID x3, LPVOID x4, LPVOID x5, LPVOID x6, LPVOID x7, LPVOID x8, + LPVOID x9, LPVOID x10, LPVOID x11, LPVOID x12) +{ + Count_myLpkTabbedTextOut++; + return fpLpkTabbedTextOut(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12); +} + +DWORD myLpkPSMTextOut (LPVOID x1,LPVOID x2,LPVOID x3,LPVOID x4,LPVOID x5,LPVOID x6) +{ + Count_myLpkPSMTextOut++; + return fpLpkPSMTextOut ( x1, x2, x3, x4, x5, x6); +} + +DWORD myLpkDrawTextEx(LPVOID x1,LPVOID x2,LPVOID x3,LPVOID x4,LPVOID x5, LPVOID x6, LPVOID x7, LPVOID x8, LPVOID x9,LPVOID x10) +{ + Count_myLpkDrawTextEx++; + return fpLpkDrawTextEx(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10); +} + + +typedef struct _USER32_INTERN_INITALIZEHOOKS +{ + PVOID fpLpkTabbedTextOut; + PVOID fpLpkPSMTextOut; + PVOID fpLpkDrawTextEx; + PLPK_LPEDITCONTROL_LIST fpListLpkEditControl; +} USER32_INTERN_INITALIZEHOOKS, *PUSER32_INTERN_INITALIZEHOOKS; + +VOID STDCALL InitializeLpkHooks (PUSER32_INTERN_INITALIZEHOOKS); + +INT +Test_InitializeLpkHooks(PTESTINFO pti) +{ + USER32_INTERN_INITALIZEHOOKS setup; + HMODULE lib = LoadLibrary("LPK.DLL"); + + TEST(lib != NULL); + if (lib != NULL) + { + fpLpkTabbedTextOut = (DWORD (APIENTRY *) (LPVOID,LPVOID,LPVOID,LPVOID,LPVOID, LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID)) GetProcAddress(lib, "LpkTabbedTextOut"); + fpLpkPSMTextOut = (DWORD (APIENTRY *) (LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID)) GetProcAddress(lib, "fpLpkPSMTextOut"); + fpLpkDrawTextEx = (DWORD (APIENTRY *) (LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID,LPVOID)) GetProcAddress(lib, "LpkDrawTextEx"); + fpLpkEditControl = (PLPK_LPEDITCONTROL_LIST (APIENTRY *) (VOID)) GetProcAddress(lib, "LpkEditControl"); + + setup.fpLpkTabbedTextOut = myLpkTabbedTextOut; + setup.fpLpkPSMTextOut = myLpkPSMTextOut; + setup.fpLpkDrawTextEx = myLpkDrawTextEx; + + /* we have not add any test to this api */ + setup.fpListLpkEditControl = (PLPK_LPEDITCONTROL_LIST)fpLpkEditControl; + + /* use our own api that we just made */ + InitializeLpkHooks(&setup); + + /* FIXME add test now */ + + /* restore */ + setup.fpLpkTabbedTextOut = fpLpkTabbedTextOut; + setup.fpLpkPSMTextOut = fpLpkPSMTextOut; + setup.fpLpkDrawTextEx = fpLpkDrawTextEx; + setup.fpListLpkEditControl = (PLPK_LPEDITCONTROL_LIST)fpLpkEditControl; + InitializeLpkHooks(&setup); + } + + return APISTATUS_NORMAL; +} + Propchange: trunk/rostests/apitests/user32api/tests/InitializeLpkHooks.c ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 5 months
1
0
0
0
[ekohl] 33696: Add the general user properties page. Settings are visible but cannot be changed yet.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun May 25 06:50:56 2008 New Revision: 33696 URL:
http://svn.reactos.org/svn/reactos?rev=33696&view=rev
Log: Add the general user properties page. Settings are visible but cannot be changed yet. Added: trunk/reactos/dll/cpl/usrmgr/userprops.c (with props) Modified: trunk/reactos/dll/cpl/usrmgr/lang/en-US.rc trunk/reactos/dll/cpl/usrmgr/resource.h (contents, props changed) trunk/reactos/dll/cpl/usrmgr/users.c (contents, props changed) trunk/reactos/dll/cpl/usrmgr/usrmgr.h (contents, props changed) trunk/reactos/dll/cpl/usrmgr/usrmgr.rbuild (contents, props changed) Modified: trunk/reactos/dll/cpl/usrmgr/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/lang/en-US.…
============================================================================== --- trunk/reactos/dll/cpl/usrmgr/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/usrmgr/lang/en-US.rc [iso-8859-1] Sun May 25 06:50:56 2008 @@ -41,8 +41,16 @@ CAPTION "General" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "", IDC_USER_NAME, 7, 7, 112, 8 - + LTEXT "", IDC_USER_GENERAL_NAME, 7, 7, 112, 8 + LTEXT "Full name:", -1, 7, 46, 63, 8 + EDITTEXT IDC_USER_GENERAL_FULL_NAME,77,43,168,13,ES_AUTOHSCROLL + LTEXT "Description:", -1, 7, 64, 63, 8 + EDITTEXT IDC_USER_GENERAL_DESCRIPTION,77,61,168,13,ES_AUTOHSCROLL + AUTOCHECKBOX "User must change the password upon first logon",IDC_USER_GENERAL_FORCE_CHANGE,7,82,210,10 + AUTOCHECKBOX "User cannot change the password",IDC_USER_GENERAL_CANNOT_CHANGE,7,95,210,10 + AUTOCHECKBOX "Password never expires",IDC_USER_GENERAL_NEVER_EXPIRES,7,108,210,10 + AUTOCHECKBOX "Account is disabled",IDC_USER_GENERAL_DISABLED,7,121,210,10 + AUTOCHECKBOX "Account is locked",IDC_USER_GENERAL_LOCKED,7,134,210,10,WS_DISABLED END @@ -131,7 +139,7 @@ MENUITEM "Delete", IDM_USER_DELETE MENUITEM "Rename", IDM_USER_RENAME MENUITEM SEPARATOR - MENUITEM "Properties", IDM_USER_PROPERTIES, GRAYED + MENUITEM "Properties", IDM_USER_PROPERTIES END END Modified: trunk/reactos/dll/cpl/usrmgr/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/resource.h?…
============================================================================== --- trunk/reactos/dll/cpl/usrmgr/resource.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/usrmgr/resource.h [iso-8859-1] Sun May 25 06:50:56 2008 @@ -1,98 +1,98 @@ -#ifndef __CPL_USRMGR_RESOURCE_H__ -#define __CPL_USRMGR_RESOURCE_H__ - -#include <commctrl.h> - -/* metrics */ -#define PROPSHEETWIDTH 246 -#define PROPSHEETHEIGHT 228 -#define PROPSHEETPADDING 6 - -#define SYSTEM_COLUMN (18 * PROPSHEETPADDING) -#define LABELLINE(x) (((PROPSHEETPADDING + 2) * x) + (x + 2)) - -#define ICONSIZE 16 - - -/* Icons */ -#define IDI_USRMGR_ICON 40 -#define IDI_USRMGR_ICON2 100 // Needed for theme compatibility with Windows. -#define IDI_USER 41 -#define IDI_LOCKED_USER 42 -#define IDI_GROUP 43 - - -#define IDD_USERS 100 -#define IDD_GROUPS 101 -#define IDD_EXTRA 102 - -#define IDC_USERS_LIST 200 - -#define IDC_GROUPS_LIST 300 - -#define IDC_STATIC -1 - - -/* Dialogs */ - -#define IDD_USER_GENERAL 310 -#define IDC_USER_NAME 311 -#define IDC_USER_FULLNAME 312 -#define IDC_USER_DESCRIPTION 313 -#define IDC_USER_PW_CHANGE 314 -#define IDC_USER_PW_NOCHANGE 315 -#define IDC_USER_PW_EXPIRE 316 -#define IDC_USER_DEACTIVATE 317 -#define IDC_USER_LOCK 318 - - -#define IDD_CHANGE_PASSWORD 350 -#define IDC_EDIT_PASSWORD1 351 -#define IDC_EDIT_PASSWORD2 352 - - -#define IDD_USER_NEW 360 -#define IDC_USER_NEW_NAME 361 -#define IDC_USER_NEW_FULL_NAME 362 -#define IDC_USER_NEW_DESCRIPTION 363 -#define IDC_USER_NEW_PASSWORD1 364 -#define IDC_USER_NEW_PASSWORD2 365 -#define IDC_USER_NEW_FORCE_CHANGE 366 -#define IDC_USER_NEW_CANNOT_CHANGE 367 -#define IDC_USER_NEW_NEVER_EXPIRES 368 -#define IDC_USER_NEW_DISABLED 369 - - -#define IDD_GROUP_NEW 370 -#define IDC_GROUP_NEW_NAME 371 -#define IDC_GROUP_NEW_DESCRIPTION 372 - - -/* Strings */ - -#define IDS_CPLNAME 2000 -#define IDS_CPLDESCRIPTION 2001 - -#define IDS_NAME 2100 -#define IDS_FULLNAME 2101 -#define IDS_DESCRIPTION 2102 - - -/* Menus */ - -#define IDM_POPUP_GROUP 120 -#define IDM_GROUP_ADD_MEMBER 121 -#define IDM_GROUP_NEW 122 -#define IDM_GROUP_DELETE 123 -#define IDM_GROUP_RENAME 124 -#define IDM_GROUP_PROPERTIES 125 - -#define IDM_POPUP_USER 130 -#define IDM_USER_CHANGE_PASSWORD 131 -#define IDM_USER_NEW 132 -#define IDM_USER_DELETE 133 -#define IDM_USER_RENAME 134 -#define IDM_USER_PROPERTIES 135 - -#endif /* __CPL_USRMGR_RESOURCE_H__ */ - +#ifndef __CPL_USRMGR_RESOURCE_H__ +#define __CPL_USRMGR_RESOURCE_H__ + +#include <commctrl.h> + +/* metrics */ +#define PROPSHEETWIDTH 246 +#define PROPSHEETHEIGHT 228 +#define PROPSHEETPADDING 6 + +#define SYSTEM_COLUMN (18 * PROPSHEETPADDING) +#define LABELLINE(x) (((PROPSHEETPADDING + 2) * x) + (x + 2)) + +#define ICONSIZE 16 + + +/* Icons */ +#define IDI_USRMGR_ICON 40 +#define IDI_USRMGR_ICON2 100 // Needed for theme compatibility with Windows. +#define IDI_USER 41 +#define IDI_LOCKED_USER 42 +#define IDI_GROUP 43 + + +#define IDD_USERS 100 +#define IDD_GROUPS 101 +#define IDD_EXTRA 102 + +#define IDC_USERS_LIST 200 + +#define IDC_GROUPS_LIST 300 + +#define IDC_STATIC -1 + + +/* Dialogs */ + +#define IDD_USER_GENERAL 310 +#define IDC_USER_GENERAL_NAME 311 +#define IDC_USER_GENERAL_FULL_NAME 312 +#define IDC_USER_GENERAL_DESCRIPTION 313 +#define IDC_USER_GENERAL_FORCE_CHANGE 314 +#define IDC_USER_GENERAL_CANNOT_CHANGE 315 +#define IDC_USER_GENERAL_NEVER_EXPIRES 316 +#define IDC_USER_GENERAL_DISABLED 317 +#define IDC_USER_GENERAL_LOCKED 318 + + +#define IDD_CHANGE_PASSWORD 350 +#define IDC_EDIT_PASSWORD1 351 +#define IDC_EDIT_PASSWORD2 352 + + +#define IDD_USER_NEW 360 +#define IDC_USER_NEW_NAME 361 +#define IDC_USER_NEW_FULL_NAME 362 +#define IDC_USER_NEW_DESCRIPTION 363 +#define IDC_USER_NEW_PASSWORD1 364 +#define IDC_USER_NEW_PASSWORD2 365 +#define IDC_USER_NEW_FORCE_CHANGE 366 +#define IDC_USER_NEW_CANNOT_CHANGE 367 +#define IDC_USER_NEW_NEVER_EXPIRES 368 +#define IDC_USER_NEW_DISABLED 369 + + +#define IDD_GROUP_NEW 370 +#define IDC_GROUP_NEW_NAME 371 +#define IDC_GROUP_NEW_DESCRIPTION 372 + + +/* Strings */ + +#define IDS_CPLNAME 2000 +#define IDS_CPLDESCRIPTION 2001 + +#define IDS_NAME 2100 +#define IDS_FULLNAME 2101 +#define IDS_DESCRIPTION 2102 + + +/* Menus */ + +#define IDM_POPUP_GROUP 120 +#define IDM_GROUP_ADD_MEMBER 121 +#define IDM_GROUP_NEW 122 +#define IDM_GROUP_DELETE 123 +#define IDM_GROUP_RENAME 124 +#define IDM_GROUP_PROPERTIES 125 + +#define IDM_POPUP_USER 130 +#define IDM_USER_CHANGE_PASSWORD 131 +#define IDM_USER_NEW 132 +#define IDM_USER_DELETE 133 +#define IDM_USER_RENAME 134 +#define IDM_USER_PROPERTIES 135 + +#endif /* __CPL_USRMGR_RESOURCE_H__ */ + Propchange: trunk/reactos/dll/cpl/usrmgr/resource.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/cpl/usrmgr/userprops.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/userprops.c…
============================================================================== --- trunk/reactos/dll/cpl/usrmgr/userprops.c (added) +++ trunk/reactos/dll/cpl/usrmgr/userprops.c [iso-8859-1] Sun May 25 06:50:56 2008 @@ -1,0 +1,167 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS User Manager Control Panel + * FILE: dll/cpl/usrmgr/users.c + * PURPOSE: Users property page + * + * PROGRAMMERS: Eric Kohl + */ + +#include "usrmgr.h" + +static VOID +UpdateUserOptions(HWND hwndDlg, + PUSER_INFO_3 userInfo, + BOOL bInit) +{ + EnableWindow(GetDlgItem(hwndDlg, IDC_USER_GENERAL_CANNOT_CHANGE), + !userInfo->usri3_password_expired); + EnableWindow(GetDlgItem(hwndDlg, IDC_USER_GENERAL_NEVER_EXPIRES), + !userInfo->usri3_password_expired); + EnableWindow(GetDlgItem(hwndDlg, IDC_USER_GENERAL_FORCE_CHANGE), + (userInfo->usri3_flags & (UF_PASSWD_CANT_CHANGE | UF_DONT_EXPIRE_PASSWD)) == 0); + + if (bInit) + { + CheckDlgButton(hwndDlg, IDC_USER_GENERAL_FORCE_CHANGE, + userInfo->usri3_password_expired ? BST_CHECKED : BST_UNCHECKED); + + CheckDlgButton(hwndDlg, IDC_USER_GENERAL_CANNOT_CHANGE, + (userInfo->usri3_flags & UF_PASSWD_CANT_CHANGE) ? BST_CHECKED : BST_UNCHECKED); + + CheckDlgButton(hwndDlg, IDC_USER_GENERAL_NEVER_EXPIRES, + (userInfo->usri3_flags & UF_DONT_EXPIRE_PASSWD) ? BST_CHECKED : BST_UNCHECKED); + + CheckDlgButton(hwndDlg, IDC_USER_GENERAL_DISABLED, + (userInfo->usri3_flags & UF_ACCOUNTDISABLE) ? BST_CHECKED : BST_UNCHECKED); + } +} + + +static VOID +GetUserData(HWND hwndDlg, LPTSTR lpUserName, PUSER_INFO_3 *usrInfo) +{ + PUSER_INFO_3 userInfo = NULL; + + SetDlgItemText(hwndDlg, IDC_USER_GENERAL_NAME, lpUserName); + + NetUserGetInfo(NULL, lpUserName, 3, (LPBYTE*)&userInfo); + + SetDlgItemText(hwndDlg, IDC_USER_GENERAL_FULL_NAME, userInfo->usri3_full_name); + SetDlgItemText(hwndDlg, IDC_USER_GENERAL_DESCRIPTION, userInfo->usri3_comment); + + UpdateUserOptions(hwndDlg, userInfo, TRUE); + + *usrInfo = userInfo; +} + + +INT_PTR CALLBACK +UserGeneralPageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + PUSER_INFO_3 userInfo; + + UNREFERENCED_PARAMETER(lParam); + UNREFERENCED_PARAMETER(wParam); + UNREFERENCED_PARAMETER(hwndDlg); + + userInfo = (PUSER_INFO_3)GetWindowLongPtr(hwndDlg, DWLP_USER); + + switch (uMsg) + { + case WM_INITDIALOG: + GetUserData(hwndDlg, + (LPTSTR)((PROPSHEETPAGE *)lParam)->lParam, + &userInfo); + SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)userInfo); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_USER_GENERAL_FORCE_CHANGE: + userInfo->usri3_password_expired = !userInfo->usri3_password_expired; + UpdateUserOptions(hwndDlg, userInfo, FALSE); + break; + + case IDC_USER_GENERAL_CANNOT_CHANGE: + userInfo->usri3_flags ^= UF_PASSWD_CANT_CHANGE; + UpdateUserOptions(hwndDlg, userInfo, FALSE); + break; + + case IDC_USER_GENERAL_NEVER_EXPIRES: + userInfo->usri3_flags ^= UF_DONT_EXPIRE_PASSWD; + UpdateUserOptions(hwndDlg, userInfo, FALSE); + break; + + case IDC_USER_GENERAL_DISABLED: + userInfo->usri3_flags ^= UF_ACCOUNTDISABLE; + break; + + case IDC_USER_GENERAL_LOCKED: + break; + } + break; + + case WM_DESTROY: + NetApiBufferFree(userInfo); + break; + } + + return FALSE; +} + + +static VOID +InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc, LPTSTR pszUser) +{ + ZeroMemory(psp, sizeof(PROPSHEETPAGE)); + psp->dwSize = sizeof(PROPSHEETPAGE); + psp->dwFlags = PSP_DEFAULT; + psp->hInstance = hApplet; + psp->pszTemplate = MAKEINTRESOURCE(idDlg); + psp->pfnDlgProc = DlgProc; + psp->lParam = (LPARAM)pszUser; +} + + +VOID +UserProperties(HWND hwndDlg) +{ + PROPSHEETPAGE psp[1]; + PROPSHEETHEADER psh; + TCHAR szUserName[UNLEN]; + INT nItem; + HWND hwndLV; + + hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST); + nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED); + if (nItem == -1) + return; + + /* Get the new user name */ + ListView_GetItemText(hwndLV, + nItem, 0, + szUserName, + UNLEN); + + ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; + psh.hwndParent = hwndDlg; + psh.hInstance = hApplet; + psh.hIcon = NULL; + psh.pszCaption = szUserName; + psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); + psh.nStartPage = 0; + psh.ppsp = psp; + + InitPropSheetPage(&psp[0], IDD_USER_GENERAL, (DLGPROC)UserGeneralPageProc, szUserName); +// InitPropSheetPage(&psp[1], IDD_USER_MEMBERSHIP, (DLGPROC)UserMembershipPageProc); +// InitPropSheetPage(&psp[2], IDD_USER_PROFILE, (DLGPROC)UserProfilePageProc); + + PropertySheet(&psh); +} Propchange: trunk/reactos/dll/cpl/usrmgr/userprops.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/cpl/usrmgr/users.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/users.c?rev…
============================================================================== --- trunk/reactos/dll/cpl/usrmgr/users.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/usrmgr/users.c [iso-8859-1] Sun May 25 06:50:56 2008 @@ -1,659 +1,664 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS User Manager Control Panel - * FILE: dll/cpl/usrmgr/users.c - * PURPOSE: Users property page - * - * PROGRAMMERS: Eric Kohl - */ - -/* - * TODO: - * - Add new user to the users group. - * - Remove a user from all groups. - * - Implement user property pages. - * - Use localized messages. - */ - -#include "usrmgr.h" - - -typedef struct _USER_DATA -{ - HMENU hPopupMenu; - - INT iCurrentItem; - -} USER_DATA, *PUSER_DATA; - - - -static BOOL -CheckPasswords(HWND hwndDlg, - INT nIdDlgItem1, - INT nIdDlgItem2) -{ - TCHAR szPassword1[256]; - TCHAR szPassword2[256]; - UINT uLen1; - UINT uLen2; - - uLen1 = GetDlgItemText(hwndDlg, nIdDlgItem1, szPassword1, 256); - uLen2 = GetDlgItemText(hwndDlg, nIdDlgItem2, szPassword2, 256); - - /* Check the passwords */ - if (uLen1 != uLen2 || _tcscmp(szPassword1, szPassword2) != 0) - { - MessageBox(hwndDlg, - TEXT("The passwords you entered are not the same!"), - TEXT("ERROR"), - MB_OK | MB_ICONERROR); - return FALSE; - } - - - return TRUE; -} - - -INT_PTR CALLBACK -ChangePasswordDlgProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - UNREFERENCED_PARAMETER(wParam); - - switch (uMsg) - { - case WM_INITDIALOG: - break; - - case WM_COMMAND: - switch (LOWORD(wParam)) - { - case IDOK: - if (CheckPasswords(hwndDlg, IDC_EDIT_PASSWORD1, IDC_EDIT_PASSWORD2)) - EndDialog(hwndDlg, 0); - break; - - case IDCANCEL: - EndDialog(hwndDlg, 0); - break; - } - break; - - default: - return FALSE; - } - - return TRUE; -} - - -static VOID -UpdateUserOptions(HWND hwndDlg, - PUSER_INFO_3 userInfo, - BOOL bInit) -{ - EnableWindow(GetDlgItem(hwndDlg, IDC_USER_NEW_CANNOT_CHANGE), - !userInfo->usri3_password_expired); - EnableWindow(GetDlgItem(hwndDlg, IDC_USER_NEW_NEVER_EXPIRES), - !userInfo->usri3_password_expired); - - EnableWindow(GetDlgItem(hwndDlg, IDC_USER_NEW_FORCE_CHANGE), - (userInfo->usri3_flags & (UF_PASSWD_CANT_CHANGE | UF_DONT_EXPIRE_PASSWD)) == 0); - - if (bInit) - { - CheckDlgButton(hwndDlg, IDC_USER_NEW_FORCE_CHANGE, - userInfo->usri3_password_expired ? BST_CHECKED : BST_UNCHECKED); - - CheckDlgButton(hwndDlg, IDC_USER_NEW_CANNOT_CHANGE, - (userInfo->usri3_flags & UF_PASSWD_CANT_CHANGE) ? BST_CHECKED : BST_UNCHECKED); - - CheckDlgButton(hwndDlg, IDC_USER_NEW_NEVER_EXPIRES, - (userInfo->usri3_flags & UF_DONT_EXPIRE_PASSWD) ? BST_CHECKED : BST_UNCHECKED); - - CheckDlgButton(hwndDlg, IDC_USER_NEW_DISABLED, - (userInfo->usri3_flags & UF_ACCOUNTDISABLE) ? BST_CHECKED : BST_UNCHECKED); - } -} - - -INT_PTR CALLBACK -NewUserDlgProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - PUSER_INFO_3 userInfo; - INT nLength; - - UNREFERENCED_PARAMETER(wParam); - - userInfo = (PUSER_INFO_3)GetWindowLongPtr(hwndDlg, DWLP_USER); - - switch (uMsg) - { - case WM_INITDIALOG: - userInfo = (PUSER_INFO_3)lParam; - SetWindowLongPtr(hwndDlg, DWLP_USER, lParam); - SendDlgItemMessage(hwndDlg, IDC_USER_NEW_NAME, EM_SETLIMITTEXT, 20, 0); - UpdateUserOptions(hwndDlg, userInfo, TRUE); - break; - - case WM_COMMAND: - switch (LOWORD(wParam)) - { - case IDC_USER_NEW_NAME: - if (HIWORD(wParam) == EN_CHANGE) - { - nLength = SendDlgItemMessage(hwndDlg, IDC_USER_NEW_NAME, WM_GETTEXTLENGTH, 0, 0); - EnableWindow(GetDlgItem(hwndDlg, IDOK), (nLength > 0)); - } - break; - - case IDC_USER_NEW_FORCE_CHANGE: - userInfo->usri3_password_expired = !userInfo->usri3_password_expired; - UpdateUserOptions(hwndDlg, userInfo, FALSE); - break; - - case IDC_USER_NEW_CANNOT_CHANGE: - userInfo->usri3_flags ^= UF_PASSWD_CANT_CHANGE; - UpdateUserOptions(hwndDlg, userInfo, FALSE); - break; - - case IDC_USER_NEW_NEVER_EXPIRES: - userInfo->usri3_flags ^= UF_DONT_EXPIRE_PASSWD; - UpdateUserOptions(hwndDlg, userInfo, FALSE); - break; - - case IDC_USER_NEW_DISABLED: - userInfo->usri3_flags ^= UF_ACCOUNTDISABLE; - break; - - case IDOK: - if (!CheckAccountName(hwndDlg, IDC_USER_NEW_NAME, NULL)) - { - SetFocus(GetDlgItem(hwndDlg, IDC_USER_NEW_NAME)); - SendDlgItemMessage(hwndDlg, IDC_USER_NEW_NAME, EM_SETSEL, 0, -1); - break; - } - - if (!CheckPasswords(hwndDlg, IDC_USER_NEW_PASSWORD1, IDC_USER_NEW_PASSWORD2)) - { - SetDlgItemText(hwndDlg, IDC_USER_NEW_PASSWORD1, TEXT("")); - SetDlgItemText(hwndDlg, IDC_USER_NEW_PASSWORD2, TEXT("")); - break; - } - - /* Store the user name */ - nLength = SendDlgItemMessage(hwndDlg, IDC_USER_NEW_NAME, WM_GETTEXTLENGTH, 0, 0); - if (nLength > 0) - { - userInfo->usri3_name = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR)); - GetDlgItemText(hwndDlg, IDC_USER_NEW_NAME, userInfo->usri3_name, nLength + 1); - } - - /* Store the full user name */ - nLength = SendDlgItemMessage(hwndDlg, IDC_USER_NEW_FULL_NAME, WM_GETTEXTLENGTH, 0, 0); - if (nLength > 0) - { - userInfo->usri3_full_name = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR)); - GetDlgItemText(hwndDlg, IDC_USER_NEW_FULL_NAME, userInfo->usri3_full_name, nLength + 1); - } - - /* Store the description */ - nLength = SendDlgItemMessage(hwndDlg, IDC_USER_NEW_DESCRIPTION, WM_GETTEXTLENGTH, 0, 0); - if (nLength > 0) - { - userInfo->usri3_comment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR)); - GetDlgItemText(hwndDlg, IDC_USER_NEW_DESCRIPTION, userInfo->usri3_comment, nLength + 1); - } - - /* Store the password */ - nLength = SendDlgItemMessage(hwndDlg, IDC_USER_NEW_PASSWORD1, WM_GETTEXTLENGTH, 0, 0); - if (nLength > 0) - { - userInfo->usri3_password = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR)); - GetDlgItemText(hwndDlg, IDC_USER_NEW_PASSWORD1, userInfo->usri3_password, nLength + 1); - } - - EndDialog(hwndDlg, IDOK); - break; - - case IDCANCEL: - EndDialog(hwndDlg, IDCANCEL); - break; - } - break; - - default: - return FALSE; - } - - return TRUE; -} - - -static VOID -UserNew(HWND hwndDlg) -{ - USER_INFO_3 user; - NET_API_STATUS status; - LV_ITEM lvi; - INT iItem; - HWND hwndLV; - - ZeroMemory(&user, sizeof(USER_INFO_3)); - - user.usri3_priv = USER_PRIV_USER; - user.usri3_flags = UF_SCRIPT; - user.usri3_acct_expires = TIMEQ_FOREVER; - user.usri3_max_storage = USER_MAXSTORAGE_UNLIMITED; - user.usri3_primary_group_id = DOMAIN_GROUP_RID_USERS; - - user.usri3_password_expired = TRUE; - - if (DialogBoxParam(hApplet, - MAKEINTRESOURCE(IDD_USER_NEW), - hwndDlg, - NewUserDlgProc, - (LPARAM)&user) == IDOK) - { -#if 0 - status = NetUserAdd(NULL, - 3, - (LPBYTE)&user, - NULL); -#else - status = NERR_Success; -#endif - if (status != NERR_Success) - { - TCHAR szText[256]; - wsprintf(szText, TEXT("Error: %u"), status); - MessageBox(NULL, szText, TEXT("NetUserAdd"), MB_ICONERROR | MB_OK); - return; - } - - hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST); - - ZeroMemory(&lvi, sizeof(lvi)); - lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE; - lvi.pszText = user.usri3_name; - lvi.state = 0; - lvi.iImage = (user.usri3_flags & UF_ACCOUNTDISABLE) ? 1 : 0; - iItem = ListView_InsertItem(hwndLV, &lvi); - - ListView_SetItemText(hwndLV, iItem, 1, - user.usri3_full_name); - - ListView_SetItemText(hwndLV, iItem, 2, - user.usri3_comment); - } - - if (user.usri3_name) - HeapFree(GetProcessHeap, 0, user.usri3_name); - - if (user.usri3_full_name) - HeapFree(GetProcessHeap, 0, user.usri3_full_name); - - if (user.usri3_comment) - HeapFree(GetProcessHeap, 0, user.usri3_comment); - - if (user.usri3_password) - HeapFree(GetProcessHeap, 0, user.usri3_password); -} - - -static VOID -UserRename(HWND hwndDlg) -{ - HWND hwndLV; - INT nItem; - - hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST); - if (hwndLV == NULL) - return; - - nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED); - if (nItem != -1) - { - (void)ListView_EditLabel(hwndLV, nItem); - } -} - - -static BOOL -UserDelete(HWND hwndDlg) -{ - TCHAR szUserName[UNLEN]; - TCHAR szText[256]; - INT nItem; - HWND hwndLV; - NET_API_STATUS status; - - hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST); - nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED); - if (nItem == -1) - return FALSE; - - /* Get the new user name */ - ListView_GetItemText(hwndLV, - nItem, 0, - szUserName, - UNLEN); - - /* Display a warning message because the delete operation cannot be reverted */ - wsprintf(szText, TEXT("Dou you really want to delete the user \"%s\"?"), szUserName); - if (MessageBox(NULL, szText, TEXT("User Accounts"), MB_ICONWARNING | MB_YESNO) == IDNO) - return FALSE; - - /* Delete the user */ -#if 0 - status = NetUserDel(NULL, szUserName); -#else - status = NERR_Success; -#endif - if (status != NERR_Success) - { - TCHAR szText[256]; - wsprintf(szText, TEXT("Error: %u"), status); - MessageBox(NULL, szText, TEXT("NetUserDel"), MB_ICONERROR | MB_OK); - return FALSE; - } - - /* Delete the user from the list */ - (void)ListView_DeleteItem(hwndLV, nItem); - - return TRUE; -} - - -static VOID -SetUsersListColumns(HWND hwndListView) -{ - LV_COLUMN column; - RECT rect; - TCHAR szStr[32]; - - GetClientRect(hwndListView, &rect); - - memset(&column, 0x00, sizeof(column)); - column.mask=LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT; - column.fmt=LVCFMT_LEFT; - column.cx = (INT)((rect.right - rect.left) * 0.25); - column.iSubItem = 0; - LoadString(hApplet, IDS_NAME, szStr, sizeof(szStr) / sizeof(szStr[0])); - column.pszText = szStr; - (void)ListView_InsertColumn(hwndListView, 0, &column); - - column.cx = (INT)((rect.right - rect.left) * 0.50); - column.iSubItem = 1; - LoadString(hApplet, IDS_FULLNAME, szStr, sizeof(szStr) / sizeof(szStr[0])); - column.pszText = szStr; - (void)ListView_InsertColumn(hwndListView, 1, &column); - - column.cx = (INT)((rect.right - rect.left) * 0.25); - column.iSubItem = 2; - LoadString(hApplet, IDS_DESCRIPTION, szStr, sizeof(szStr) / sizeof(szStr[0])); - column.pszText = szStr; - (void)ListView_InsertColumn(hwndListView, 2, &column); -} - - -static VOID -UpdateUsersList(HWND hwndListView) -{ - NET_API_STATUS netStatus; - PUSER_INFO_20 pBuffer; - DWORD entriesread; - DWORD totalentries; - DWORD resume_handle = 0; - DWORD i; - LV_ITEM lvi; - INT iItem; - - - for (;;) - { - netStatus = NetUserEnum(NULL, 20, FILTER_NORMAL_ACCOUNT, - (LPBYTE*)&pBuffer, - 1024, &entriesread, - &totalentries, &resume_handle); - if (netStatus != NERR_Success && netStatus != ERROR_MORE_DATA) - break; - - for (i = 0; i < entriesread; i++) - { - memset(&lvi, 0x00, sizeof(lvi)); - lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE; - lvi.pszText = pBuffer[i].usri20_name; - lvi.state = 0; - lvi.iImage = (pBuffer[i].usri20_flags & UF_ACCOUNTDISABLE) ? 1 : 0; - iItem = ListView_InsertItem(hwndListView, &lvi); - - ListView_SetItemText(hwndListView, iItem, 1, - pBuffer[i].usri20_full_name); - - ListView_SetItemText(hwndListView, iItem, 2, - pBuffer[i].usri20_comment); - } - - NetApiBufferFree(&pBuffer); - - /* No more data left */ - if (netStatus != ERROR_MORE_DATA) - break; - } - -} - - -static VOID -OnInitDialog(HWND hwndDlg) -{ - HWND hwndListView; - HIMAGELIST hImgList; - HICON hIcon; - - /* Create the image list */ - hImgList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 5, 5); - hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); - ImageList_AddIcon(hImgList, hIcon); - hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_LOCKED_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); - ImageList_AddIcon(hImgList, hIcon); - DestroyIcon(hIcon); - - hwndListView = GetDlgItem(hwndDlg, IDC_USERS_LIST); - - (VOID)ListView_SetImageList(hwndListView, hImgList, LVSIL_SMALL); - - (void)ListView_SetExtendedListViewStyle(hwndListView, LVS_EX_FULLROWSELECT); - - SetUsersListColumns(hwndListView); - - UpdateUsersList(hwndListView); -} - - -static BOOL -OnBeginLabelEdit(LPNMLVDISPINFO pnmv) -{ - HWND hwndEdit; - - hwndEdit = ListView_GetEditControl(pnmv->hdr.hwndFrom); - if (hwndEdit == NULL) - return TRUE; - - SendMessage(hwndEdit, EM_SETLIMITTEXT, 20, 0); - - return FALSE; -} - - -static BOOL -OnEndLabelEdit(LPNMLVDISPINFO pnmv) -{ - TCHAR szOldUserName[UNLEN]; - TCHAR szNewUserName[UNLEN]; - USER_INFO_0 useri0; - NET_API_STATUS status; - - /* Leave, if there is no valid listview item */ - if (pnmv->item.iItem == -1) - return FALSE; - - /* Get the new user name */ - ListView_GetItemText(pnmv->hdr.hwndFrom, - pnmv->item.iItem, 0, - szOldUserName, - UNLEN); - - /* Leave, if the user canceled the edit action */ - if (pnmv->item.pszText == NULL) - return FALSE; - - /* Get the new user name */ - lstrcpy(szNewUserName, pnmv->item.pszText); - - /* Leave, if the user name was not changed */ - if (lstrcmp(szOldUserName, szNewUserName) == 0) - return FALSE; - - /* Check the user name for illegal characters */ - if (!CheckAccountName(NULL, 0, szNewUserName)) - return FALSE; - - /* Change the user name */ - useri0.usri0_name = szNewUserName; - -#if 0 - status = NetUserSetInfo(NULL, szOldUserName, 0, (LPBYTE)&useri0, NULL); -#else - status = NERR_Success; -#endif - if (status != NERR_Success) - { - TCHAR szText[256]; - wsprintf(szText, TEXT("Error: %u"), status); - MessageBox(NULL, szText, TEXT("NetUserSetInfo"), MB_ICONERROR | MB_OK); - return FALSE; - } - - /* Update the listview item */ - ListView_SetItemText(pnmv->hdr.hwndFrom, - pnmv->item.iItem, 0, - szNewUserName); - - return TRUE; -} - - -static BOOL -OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr) -{ - LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr; - - switch (phdr->idFrom) - { - case IDC_USERS_LIST: - switch(phdr->code) - { - case NM_CLICK: - pUserData->iCurrentItem = lpnmlv->iItem; - if (lpnmlv->iItem == -1) - { - } - else - { - } - break; - - case NM_DBLCLK: - break; - - case NM_RCLICK: - ClientToScreen(GetDlgItem(hwndDlg, IDC_USERS_LIST), &lpnmlv->ptAction); - TrackPopupMenu(GetSubMenu(pUserData->hPopupMenu, (lpnmlv->iItem == -1) ? 0 : 1), - TPM_LEFTALIGN, lpnmlv->ptAction.x, lpnmlv->ptAction.y, 0, hwndDlg, NULL); - break; - - case LVN_BEGINLABELEDIT: - return OnBeginLabelEdit((LPNMLVDISPINFO)phdr); - - case LVN_ENDLABELEDIT: - return OnEndLabelEdit((LPNMLVDISPINFO)phdr); - } - break; - } - - return FALSE; -} - - -INT_PTR CALLBACK -UsersPageProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) -{ - PUSER_DATA pUserData; - - UNREFERENCED_PARAMETER(wParam); - - pUserData = (PUSER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER); - - switch (uMsg) - { - case WM_INITDIALOG: - pUserData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(USER_DATA)); - SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pUserData); - - pUserData->hPopupMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDM_POPUP_USER)); - - OnInitDialog(hwndDlg); - break; - - case WM_COMMAND: - switch (LOWORD(wParam)) - { - case IDM_USER_CHANGE_PASSWORD: - DialogBoxParam(hApplet, - MAKEINTRESOURCE(IDD_CHANGE_PASSWORD), - hwndDlg, - ChangePasswordDlgProc, - (LPARAM)NULL); - break; - - case IDM_USER_RENAME: - UserRename(hwndDlg); - break; - - case IDM_USER_NEW: - UserNew(hwndDlg); - break; - - case IDM_USER_DELETE: - UserDelete(hwndDlg); - break; - - case IDM_USER_PROPERTIES: - MessageBeep(-1); - break; - } - break; - - case WM_NOTIFY: - return OnNotify(hwndDlg, pUserData, (NMHDR *)lParam); - - case WM_DESTROY: - DestroyMenu(pUserData->hPopupMenu); - HeapFree(GetProcessHeap(), 0, pUserData); - break; - } - - return FALSE; -} +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS User Manager Control Panel + * FILE: dll/cpl/usrmgr/users.c + * PURPOSE: Users property page + * + * PROGRAMMERS: Eric Kohl + */ + +/* + * TODO: + * - Add new user to the users group. + * - Remove a user from all groups. + * - Use localized messages. + */ + +#include "usrmgr.h" + + +typedef struct _USER_DATA +{ + HMENU hPopupMenu; + + INT iCurrentItem; + +} USER_DATA, *PUSER_DATA; + + + +static BOOL +CheckPasswords(HWND hwndDlg, + INT nIdDlgItem1, + INT nIdDlgItem2) +{ + TCHAR szPassword1[256]; + TCHAR szPassword2[256]; + UINT uLen1; + UINT uLen2; + + uLen1 = GetDlgItemText(hwndDlg, nIdDlgItem1, szPassword1, 256); + uLen2 = GetDlgItemText(hwndDlg, nIdDlgItem2, szPassword2, 256); + + /* Check the passwords */ + if (uLen1 != uLen2 || _tcscmp(szPassword1, szPassword2) != 0) + { + MessageBox(hwndDlg, + TEXT("The passwords you entered are not the same!"), + TEXT("ERROR"), + MB_OK | MB_ICONERROR); + return FALSE; + } + + + return TRUE; +} + + +INT_PTR CALLBACK +ChangePasswordDlgProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + UNREFERENCED_PARAMETER(wParam); + + switch (uMsg) + { + case WM_INITDIALOG: + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDOK: + if (CheckPasswords(hwndDlg, IDC_EDIT_PASSWORD1, IDC_EDIT_PASSWORD2)) + EndDialog(hwndDlg, 0); + break; + + case IDCANCEL: + EndDialog(hwndDlg, 0); + break; + } + break; + + default: + return FALSE; + } + + return TRUE; +} + + +static VOID +UpdateUserOptions(HWND hwndDlg, + PUSER_INFO_3 userInfo, + BOOL bInit) +{ + EnableWindow(GetDlgItem(hwndDlg, IDC_USER_NEW_CANNOT_CHANGE), + !userInfo->usri3_password_expired); + EnableWindow(GetDlgItem(hwndDlg, IDC_USER_NEW_NEVER_EXPIRES), + !userInfo->usri3_password_expired); + + EnableWindow(GetDlgItem(hwndDlg, IDC_USER_NEW_FORCE_CHANGE), + (userInfo->usri3_flags & (UF_PASSWD_CANT_CHANGE | UF_DONT_EXPIRE_PASSWD)) == 0); + + if (bInit) + { + CheckDlgButton(hwndDlg, IDC_USER_NEW_FORCE_CHANGE, + userInfo->usri3_password_expired ? BST_CHECKED : BST_UNCHECKED); + + CheckDlgButton(hwndDlg, IDC_USER_NEW_CANNOT_CHANGE, + (userInfo->usri3_flags & UF_PASSWD_CANT_CHANGE) ? BST_CHECKED : BST_UNCHECKED); + + CheckDlgButton(hwndDlg, IDC_USER_NEW_NEVER_EXPIRES, + (userInfo->usri3_flags & UF_DONT_EXPIRE_PASSWD) ? BST_CHECKED : BST_UNCHECKED); + + CheckDlgButton(hwndDlg, IDC_USER_NEW_DISABLED, + (userInfo->usri3_flags & UF_ACCOUNTDISABLE) ? BST_CHECKED : BST_UNCHECKED); + } +} + + +INT_PTR CALLBACK +NewUserDlgProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + PUSER_INFO_3 userInfo; + INT nLength; + + UNREFERENCED_PARAMETER(wParam); + + userInfo = (PUSER_INFO_3)GetWindowLongPtr(hwndDlg, DWLP_USER); + + switch (uMsg) + { + case WM_INITDIALOG: + userInfo = (PUSER_INFO_3)lParam; + SetWindowLongPtr(hwndDlg, DWLP_USER, lParam); + SendDlgItemMessage(hwndDlg, IDC_USER_NEW_NAME, EM_SETLIMITTEXT, 20, 0); + UpdateUserOptions(hwndDlg, userInfo, TRUE); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_USER_NEW_NAME: + if (HIWORD(wParam) == EN_CHANGE) + { + nLength = SendDlgItemMessage(hwndDlg, IDC_USER_NEW_NAME, WM_GETTEXTLENGTH, 0, 0); + EnableWindow(GetDlgItem(hwndDlg, IDOK), (nLength > 0)); + } + break; + + case IDC_USER_NEW_FORCE_CHANGE: + userInfo->usri3_password_expired = !userInfo->usri3_password_expired; + UpdateUserOptions(hwndDlg, userInfo, FALSE); + break; + + case IDC_USER_NEW_CANNOT_CHANGE: + userInfo->usri3_flags ^= UF_PASSWD_CANT_CHANGE; + UpdateUserOptions(hwndDlg, userInfo, FALSE); + break; + + case IDC_USER_NEW_NEVER_EXPIRES: + userInfo->usri3_flags ^= UF_DONT_EXPIRE_PASSWD; + UpdateUserOptions(hwndDlg, userInfo, FALSE); + break; + + case IDC_USER_NEW_DISABLED: + userInfo->usri3_flags ^= UF_ACCOUNTDISABLE; + break; + + case IDOK: + if (!CheckAccountName(hwndDlg, IDC_USER_NEW_NAME, NULL)) + { + SetFocus(GetDlgItem(hwndDlg, IDC_USER_NEW_NAME)); + SendDlgItemMessage(hwndDlg, IDC_USER_NEW_NAME, EM_SETSEL, 0, -1); + break; + } + + if (!CheckPasswords(hwndDlg, IDC_USER_NEW_PASSWORD1, IDC_USER_NEW_PASSWORD2)) + { + SetDlgItemText(hwndDlg, IDC_USER_NEW_PASSWORD1, TEXT("")); + SetDlgItemText(hwndDlg, IDC_USER_NEW_PASSWORD2, TEXT("")); + break; + } + + /* Store the user name */ + nLength = SendDlgItemMessage(hwndDlg, IDC_USER_NEW_NAME, WM_GETTEXTLENGTH, 0, 0); + if (nLength > 0) + { + userInfo->usri3_name = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR)); + GetDlgItemText(hwndDlg, IDC_USER_NEW_NAME, userInfo->usri3_name, nLength + 1); + } + + /* Store the full user name */ + nLength = SendDlgItemMessage(hwndDlg, IDC_USER_NEW_FULL_NAME, WM_GETTEXTLENGTH, 0, 0); + if (nLength > 0) + { + userInfo->usri3_full_name = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR)); + GetDlgItemText(hwndDlg, IDC_USER_NEW_FULL_NAME, userInfo->usri3_full_name, nLength + 1); + } + + /* Store the description */ + nLength = SendDlgItemMessage(hwndDlg, IDC_USER_NEW_DESCRIPTION, WM_GETTEXTLENGTH, 0, 0); + if (nLength > 0) + { + userInfo->usri3_comment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR)); + GetDlgItemText(hwndDlg, IDC_USER_NEW_DESCRIPTION, userInfo->usri3_comment, nLength + 1); + } + + /* Store the password */ + nLength = SendDlgItemMessage(hwndDlg, IDC_USER_NEW_PASSWORD1, WM_GETTEXTLENGTH, 0, 0); + if (nLength > 0) + { + userInfo->usri3_password = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (nLength + 1) * sizeof(WCHAR)); + GetDlgItemText(hwndDlg, IDC_USER_NEW_PASSWORD1, userInfo->usri3_password, nLength + 1); + } + + EndDialog(hwndDlg, IDOK); + break; + + case IDCANCEL: + EndDialog(hwndDlg, IDCANCEL); + break; + } + break; + + default: + return FALSE; + } + + return TRUE; +} + + +static VOID +UserNew(HWND hwndDlg) +{ + USER_INFO_3 user; + NET_API_STATUS status; + LV_ITEM lvi; + INT iItem; + HWND hwndLV; + + ZeroMemory(&user, sizeof(USER_INFO_3)); + + user.usri3_priv = USER_PRIV_USER; + user.usri3_flags = UF_SCRIPT; + user.usri3_acct_expires = TIMEQ_FOREVER; + user.usri3_max_storage = USER_MAXSTORAGE_UNLIMITED; + user.usri3_primary_group_id = DOMAIN_GROUP_RID_USERS; + + user.usri3_password_expired = TRUE; + + if (DialogBoxParam(hApplet, + MAKEINTRESOURCE(IDD_USER_NEW), + hwndDlg, + NewUserDlgProc, + (LPARAM)&user) == IDOK) + { +#if 0 + status = NetUserAdd(NULL, + 3, + (LPBYTE)&user, + NULL); +#else + status = NERR_Success; +#endif + if (status != NERR_Success) + { + TCHAR szText[256]; + wsprintf(szText, TEXT("Error: %u"), status); + MessageBox(NULL, szText, TEXT("NetUserAdd"), MB_ICONERROR | MB_OK); + return; + } + + hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST); + + ZeroMemory(&lvi, sizeof(lvi)); + lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE; + lvi.pszText = user.usri3_name; + lvi.state = 0; + lvi.iImage = (user.usri3_flags & UF_ACCOUNTDISABLE) ? 1 : 0; + iItem = ListView_InsertItem(hwndLV, &lvi); + + ListView_SetItemText(hwndLV, iItem, 1, + user.usri3_full_name); + + ListView_SetItemText(hwndLV, iItem, 2, + user.usri3_comment); + } + + if (user.usri3_name) + HeapFree(GetProcessHeap, 0, user.usri3_name); + + if (user.usri3_full_name) + HeapFree(GetProcessHeap, 0, user.usri3_full_name); + + if (user.usri3_comment) + HeapFree(GetProcessHeap, 0, user.usri3_comment); + + if (user.usri3_password) + HeapFree(GetProcessHeap, 0, user.usri3_password); +} + + +static VOID +UserRename(HWND hwndDlg) +{ + HWND hwndLV; + INT nItem; + + hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST); + if (hwndLV == NULL) + return; + + nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED); + if (nItem != -1) + { + (void)ListView_EditLabel(hwndLV, nItem); + } +} + + +static BOOL +UserDelete(HWND hwndDlg) +{ + TCHAR szUserName[UNLEN]; + TCHAR szText[256]; + INT nItem; + HWND hwndLV; + NET_API_STATUS status; + + hwndLV = GetDlgItem(hwndDlg, IDC_USERS_LIST); + nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED); + if (nItem == -1) + return FALSE; + + /* Get the new user name */ + ListView_GetItemText(hwndLV, + nItem, 0, + szUserName, + UNLEN); + + /* Display a warning message because the delete operation cannot be reverted */ + wsprintf(szText, TEXT("Dou you really want to delete the user \"%s\"?"), szUserName); + if (MessageBox(NULL, szText, TEXT("User Accounts"), MB_ICONWARNING | MB_YESNO) == IDNO) + return FALSE; + + /* Delete the user */ +#if 0 + status = NetUserDel(NULL, szUserName); +#else + status = NERR_Success; +#endif + if (status != NERR_Success) + { + TCHAR szText[256]; + wsprintf(szText, TEXT("Error: %u"), status); + MessageBox(NULL, szText, TEXT("NetUserDel"), MB_ICONERROR | MB_OK); + return FALSE; + } + + /* Delete the user from the list */ + (void)ListView_DeleteItem(hwndLV, nItem); + + return TRUE; +} + + +static VOID +SetUsersListColumns(HWND hwndListView) +{ + LV_COLUMN column; + RECT rect; + TCHAR szStr[32]; + + GetClientRect(hwndListView, &rect); + + memset(&column, 0x00, sizeof(column)); + column.mask=LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM | LVCF_TEXT; + column.fmt=LVCFMT_LEFT; + column.cx = (INT)((rect.right - rect.left) * 0.25); + column.iSubItem = 0; + LoadString(hApplet, IDS_NAME, szStr, sizeof(szStr) / sizeof(szStr[0])); + column.pszText = szStr; + (void)ListView_InsertColumn(hwndListView, 0, &column); + + column.cx = (INT)((rect.right - rect.left) * 0.50); + column.iSubItem = 1; + LoadString(hApplet, IDS_FULLNAME, szStr, sizeof(szStr) / sizeof(szStr[0])); + column.pszText = szStr; + (void)ListView_InsertColumn(hwndListView, 1, &column); + + column.cx = (INT)((rect.right - rect.left) * 0.25); + column.iSubItem = 2; + LoadString(hApplet, IDS_DESCRIPTION, szStr, sizeof(szStr) / sizeof(szStr[0])); + column.pszText = szStr; + (void)ListView_InsertColumn(hwndListView, 2, &column); +} + + +static VOID +UpdateUsersList(HWND hwndListView) +{ + NET_API_STATUS netStatus; + PUSER_INFO_20 pBuffer; + DWORD entriesread; + DWORD totalentries; + DWORD resume_handle = 0; + DWORD i; + LV_ITEM lvi; + INT iItem; + + + for (;;) + { + netStatus = NetUserEnum(NULL, 20, FILTER_NORMAL_ACCOUNT, + (LPBYTE*)&pBuffer, + 1024, &entriesread, + &totalentries, &resume_handle); + if (netStatus != NERR_Success && netStatus != ERROR_MORE_DATA) + break; + + for (i = 0; i < entriesread; i++) + { + memset(&lvi, 0x00, sizeof(lvi)); + lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE; + lvi.pszText = pBuffer[i].usri20_name; + lvi.state = 0; + lvi.iImage = (pBuffer[i].usri20_flags & UF_ACCOUNTDISABLE) ? 1 : 0; + iItem = ListView_InsertItem(hwndListView, &lvi); + + ListView_SetItemText(hwndListView, iItem, 1, + pBuffer[i].usri20_full_name); + + ListView_SetItemText(hwndListView, iItem, 2, + pBuffer[i].usri20_comment); + } + + NetApiBufferFree(&pBuffer); + + /* No more data left */ + if (netStatus != ERROR_MORE_DATA) + break; + } + +} + + +static VOID +OnInitDialog(HWND hwndDlg) +{ + HWND hwndListView; + HIMAGELIST hImgList; + HICON hIcon; + + /* Create the image list */ + hImgList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 5, 5); + hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + ImageList_AddIcon(hImgList, hIcon); + hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_LOCKED_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + ImageList_AddIcon(hImgList, hIcon); + DestroyIcon(hIcon); + + hwndListView = GetDlgItem(hwndDlg, IDC_USERS_LIST); + + (VOID)ListView_SetImageList(hwndListView, hImgList, LVSIL_SMALL); + + (void)ListView_SetExtendedListViewStyle(hwndListView, LVS_EX_FULLROWSELECT); + + SetUsersListColumns(hwndListView); + + UpdateUsersList(hwndListView); +} + + +static BOOL +OnBeginLabelEdit(LPNMLVDISPINFO pnmv) +{ + HWND hwndEdit; + + hwndEdit = ListView_GetEditControl(pnmv->hdr.hwndFrom); + if (hwndEdit == NULL) + return TRUE; + + SendMessage(hwndEdit, EM_SETLIMITTEXT, 20, 0); + + return FALSE; +} + + +static BOOL +OnEndLabelEdit(LPNMLVDISPINFO pnmv) +{ + TCHAR szOldUserName[UNLEN]; + TCHAR szNewUserName[UNLEN]; + USER_INFO_0 useri0; + NET_API_STATUS status; + + /* Leave, if there is no valid listview item */ + if (pnmv->item.iItem == -1) + return FALSE; + + /* Get the new user name */ + ListView_GetItemText(pnmv->hdr.hwndFrom, + pnmv->item.iItem, 0, + szOldUserName, + UNLEN); + + /* Leave, if the user canceled the edit action */ + if (pnmv->item.pszText == NULL) + return FALSE; + + /* Get the new user name */ + lstrcpy(szNewUserName, pnmv->item.pszText); + + /* Leave, if the user name was not changed */ + if (lstrcmp(szOldUserName, szNewUserName) == 0) + return FALSE; + + /* Check the user name for illegal characters */ + if (!CheckAccountName(NULL, 0, szNewUserName)) + return FALSE; + + /* Change the user name */ + useri0.usri0_name = szNewUserName; + +#if 0 + status = NetUserSetInfo(NULL, szOldUserName, 0, (LPBYTE)&useri0, NULL); +#else + status = NERR_Success; +#endif + if (status != NERR_Success) + { + TCHAR szText[256]; + wsprintf(szText, TEXT("Error: %u"), status); + MessageBox(NULL, szText, TEXT("NetUserSetInfo"), MB_ICONERROR | MB_OK); + return FALSE; + } + + /* Update the listview item */ + ListView_SetItemText(pnmv->hdr.hwndFrom, + pnmv->item.iItem, 0, + szNewUserName); + + return TRUE; +} + + +static BOOL +OnNotify(HWND hwndDlg, PUSER_DATA pUserData, NMHDR *phdr) +{ + LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)phdr; + + switch (phdr->idFrom) + { + case IDC_USERS_LIST: + switch(phdr->code) + { + case NM_CLICK: + pUserData->iCurrentItem = lpnmlv->iItem; + break; + + case NM_DBLCLK: + if (lpnmlv->iItem != -1) + { + UINT uItem; + + uItem = GetMenuDefaultItem(GetSubMenu(pUserData->hPopupMenu, 1), + FALSE, 0); + if (uItem != (UINT)-1) + SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(uItem, 0), 0); + } + break; + + case NM_RCLICK: + ClientToScreen(GetDlgItem(hwndDlg, IDC_USERS_LIST), &lpnmlv->ptAction); + TrackPopupMenu(GetSubMenu(pUserData->hPopupMenu, (lpnmlv->iItem == -1) ? 0 : 1), + TPM_LEFTALIGN, lpnmlv->ptAction.x, lpnmlv->ptAction.y, 0, hwndDlg, NULL); + break; + + case LVN_BEGINLABELEDIT: + return OnBeginLabelEdit((LPNMLVDISPINFO)phdr); + + case LVN_ENDLABELEDIT: + return OnEndLabelEdit((LPNMLVDISPINFO)phdr); + } + break; + } + + return FALSE; +} + + +INT_PTR CALLBACK +UsersPageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + PUSER_DATA pUserData; + + UNREFERENCED_PARAMETER(wParam); + + pUserData = (PUSER_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER); + + switch (uMsg) + { + case WM_INITDIALOG: + pUserData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(USER_DATA)); + SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pUserData); + + pUserData->hPopupMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDM_POPUP_USER)); + + OnInitDialog(hwndDlg); + SetMenuDefaultItem(GetSubMenu(pUserData->hPopupMenu, 1), + IDM_USER_PROPERTIES, + FALSE); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDM_USER_CHANGE_PASSWORD: + DialogBoxParam(hApplet, + MAKEINTRESOURCE(IDD_CHANGE_PASSWORD), + hwndDlg, + ChangePasswordDlgProc, + (LPARAM)NULL); + break; + + case IDM_USER_RENAME: + UserRename(hwndDlg); + break; + + case IDM_USER_NEW: + UserNew(hwndDlg); + break; + + case IDM_USER_DELETE: + UserDelete(hwndDlg); + break; + + case IDM_USER_PROPERTIES: + UserProperties(hwndDlg); + break; + } + break; + + case WM_NOTIFY: + return OnNotify(hwndDlg, pUserData, (NMHDR *)lParam); + + case WM_DESTROY: + DestroyMenu(pUserData->hPopupMenu); + HeapFree(GetProcessHeap(), 0, pUserData); + break; + } + + return FALSE; +} Propchange: trunk/reactos/dll/cpl/usrmgr/users.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/cpl/usrmgr/usrmgr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/usrmgr.h?re…
============================================================================== --- trunk/reactos/dll/cpl/usrmgr/usrmgr.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/usrmgr/usrmgr.h [iso-8859-1] Sun May 25 06:50:56 2008 @@ -1,39 +1,43 @@ -#ifndef __CPL_DESK_H__ -#define __CPL_DESK_H__ - -#include <windows.h> -#include <commctrl.h> -#include <commdlg.h> -#include <cpl.h> -#include <tchar.h> -#include <setupapi.h> -#include <lmaccess.h> -#include <lmapibuf.h> -#include <lmerr.h> -#include <stdio.h> - -#include "resource.h" - -typedef struct _APPLET -{ - int idIcon; - int idName; - int idDescription; - APPLET_PROC AppletProc; -} APPLET, *PAPPLET; - -extern HINSTANCE hApplet; - - -INT_PTR CALLBACK UsersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK GroupsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK ExtraPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - -/* misc.c */ -BOOL -CheckAccountName(HWND hwndDlg, - INT nIdDlgItem, - LPTSTR lpAccountName); - -#endif /* __CPL_DESK_H__ */ - +#ifndef __CPL_DESK_H__ +#define __CPL_DESK_H__ + +#include <windows.h> +#include <commctrl.h> +#include <commdlg.h> +#include <cpl.h> +#include <tchar.h> +#include <setupapi.h> +#include <lmaccess.h> +#include <lmapibuf.h> +#include <lmerr.h> +#include <stdio.h> + +#include "resource.h" + +typedef struct _APPLET +{ + int idIcon; + int idName; + int idDescription; + APPLET_PROC AppletProc; +} APPLET, *PAPPLET; + +extern HINSTANCE hApplet; + + +INT_PTR CALLBACK UsersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK GroupsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK ExtraPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + +/* misc.c */ +BOOL +CheckAccountName(HWND hwndDlg, + INT nIdDlgItem, + LPTSTR lpAccountName); + +/* userprops.c */ +VOID +UserProperties(HWND hwndDlg); + +#endif /* __CPL_DESK_H__ */ + Propchange: trunk/reactos/dll/cpl/usrmgr/usrmgr.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/cpl/usrmgr/usrmgr.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/usrmgr.rbui…
============================================================================== --- trunk/reactos/dll/cpl/usrmgr/usrmgr.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/usrmgr/usrmgr.rbuild [iso-8859-1] Sun May 25 06:50:56 2008 @@ -1,22 +1,23 @@ -<?xml version="1.0"?> -<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="usrmgr" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_USRMGR}" installbase="system32" installname="usrmgr.cpl" unicode="yes"> - <importlibrary definition="usrmgr.def" /> - <include base="usrmgr">.</include> - <define name="_WIN32_IE">0x600</define> - <define name="_WIN32_WINNT">0x501</define> - <define name="WINVER">0x609</define> - <library>kernel32</library> - <library>user32</library> - <library>gdi32</library> - <library>comctl32</library> - <library>ntdll</library> - <library>netapi32</library> - <library>msvcrt</library> - <file>extra.c</file> - <file>groups.c</file> - <file>misc.c</file> - <file>users.c</file> - <file>usrmgr.c</file> - <file>usrmgr.rc</file> -</module> +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<module name="usrmgr" type="win32dll" extension=".cpl" baseaddress="${BASEADDRESS_USRMGR}" installbase="system32" installname="usrmgr.cpl" unicode="yes"> + <importlibrary definition="usrmgr.def" /> + <include base="usrmgr">.</include> + <define name="_WIN32_IE">0x600</define> + <define name="_WIN32_WINNT">0x501</define> + <define name="WINVER">0x609</define> + <library>kernel32</library> + <library>user32</library> + <library>gdi32</library> + <library>comctl32</library> + <library>ntdll</library> + <library>netapi32</library> + <library>msvcrt</library> + <file>extra.c</file> + <file>groups.c</file> + <file>misc.c</file> + <file>userprops.c</file> + <file>users.c</file> + <file>usrmgr.c</file> + <file>usrmgr.rc</file> +</module> Propchange: trunk/reactos/dll/cpl/usrmgr/usrmgr.rbuild ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 5 months
1
0
0
0
[gbrunmar] 33695: Reinstated DIALOG_get_info() based of Wine's implementation, but with some modifications. This makes us pass the last 6 failed dialog wine tests.
by gbrunmar@svn.reactos.org
Author: gbrunmar Date: Sun May 25 06:12:42 2008 New Revision: 33695 URL:
http://svn.reactos.org/svn/reactos?rev=33695&view=rev
Log: Reinstated DIALOG_get_info() based of Wine's implementation, but with some modifications. This makes us pass the last 6 failed dialog wine tests. Modified: trunk/reactos/dll/win32/user32/windows/dialog.c Modified: trunk/reactos/dll/win32/user32/windows/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] Sun May 25 06:12:42 2008 @@ -42,7 +42,7 @@ #define DF_OWNERENABLED 0x0002 #define CW_USEDEFAULT16 ((short)0x8000) #define DWLP_ROS_DIALOGINFO (DWLP_USER+sizeof(ULONG_PTR)) -#define GETDLGINFO(hwnd) (DIALOGINFO*)GetWindowLongPtrW((hwnd),DWLP_ROS_DIALOGINFO) +#define GETDLGINFO(hwnd) DIALOG_get_info(hwnd, FALSE) #define SETDLGINFO(hwnd, info) SetWindowLongPtrW((hwnd), DWLP_ROS_DIALOGINFO, (LONG_PTR)(info)) #define GET_WORD(ptr) (*(WORD *)(ptr)) #define GET_DWORD(ptr) (*(DWORD *)(ptr)) @@ -138,7 +138,38 @@ /* INTERNAL FUNCTIONS ********************************************************/ - /*********************************************************************** +/*********************************************************************** +* DIALOG_get_info +* +* Get the DIALOGINFO structure of a window, allocating it if needed +* and 'create' is TRUE. +*/ +DIALOGINFO * DIALOG_get_info( HWND hWnd, BOOL create ) +{ + PWINDOW pWindow; + DIALOGINFO* dlgInfo = (DIALOGINFO *)GetWindowLongPtrW( hWnd, DWLP_ROS_DIALOGINFO ); + + if(!dlgInfo && create) + { + pWindow = ValidateHwnd( hWnd ); + + if (pWindow && pWindow->ExtraDataSize >= DLGWINDOWEXTRA && hWnd != GetDesktopWindow()) + { + if (!(dlgInfo = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*dlgInfo) ))) + return NULL; + + SETDLGINFO( hWnd, dlgInfo ); + } + else + { + HeapFree( GetProcessHeap(), 0, dlgInfo ); + return NULL; + } + } + return dlgInfo; +} + +/*********************************************************************** * DIALOG_EnableOwner * * Helper function for modal dialogs to enable again the @@ -802,17 +833,21 @@ will be valid only after WM_CREATE message has been handled in DefDlgProc All the members of the structure get filled here using temp variables */ -// dlgInfo = DIALOG_get_info( hwnd, TRUE ); - - if (!(dlgInfo = HeapAlloc( GetProcessHeap(), 0, sizeof(*dlgInfo) ))) return 0; - SETDLGINFO(hwnd, dlgInfo); - - dlgInfo->hwndFocus = 0; + dlgInfo = DIALOG_get_info( hwnd, TRUE ); + if (dlgInfo == NULL) + { + if (hUserFont) DeleteObject( hUserFont ); + if (hMenu) DestroyMenu( hMenu ); + if (modal && (flags & DF_OWNERENABLED)) DIALOG_EnableOwner(owner); + return 0; + } + +// dlgInfo->hwndFocus = 0; dlgInfo->hUserFont = hUserFont; dlgInfo->hMenu = hMenu; dlgInfo->xBaseUnit = xBaseUnit; dlgInfo->yBaseUnit = yBaseUnit; - dlgInfo->idResult = 0; +// dlgInfo->idResult = 0; dlgInfo->flags = flags; // dlgInfo->hDialogHeap = 0; @@ -1500,7 +1535,7 @@ DIALOGINFO * dlgInfo; /* if there's no dialog info property then call default windows proc?? */ - if (!(dlgInfo = GETDLGINFO(hDlg))) + if (!(dlgInfo = DIALOG_get_info(hDlg, TRUE))) return DefWindowProcA( hDlg, Msg, wParam, lParam ); SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 ); @@ -1561,7 +1596,7 @@ DIALOGINFO * dlgInfo; /* if there's no dialog info property then call default windows proc?? */ - if (!(dlgInfo = GETDLGINFO(hDlg))) + if (!(dlgInfo = DIALOG_get_info(hDlg, TRUE))) return DefWindowProcW( hDlg, Msg, wParam, lParam ); SetWindowLongPtrW( hDlg, DWLP_MSGRESULT, 0 );
16 years, 5 months
1
0
0
0
[dchapyshev] 33694: - Start implementing WDM Audio driver mapper
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun May 25 05:41:08 2008 New Revision: 33694 URL:
http://svn.reactos.org/svn/reactos?rev=33694&view=rev
Log: - Start implementing WDM Audio driver mapper Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] Sun May 25 05:41:08 2008 @@ -13,6 +13,9 @@ #include <windows.h> #include <mmsystem.h> +#include <mmddk.h> +#include <mmreg.h> +#include <debug.h> DWORD APIENTRY mxdMessage(UINT uDevice, @@ -21,6 +24,38 @@ DWORD dwParam1, DWORD dwParam2) { + DPRINT1("mxdMessage(%04X, %04X, %08X, %08X, %08X);\n", uDevice, uMsg, dwUser, dwParam1, dwParam2); + + switch (uMsg) + { + case MXDM_INIT: + break; + + case MXDM_GETNUMDEVS: + break; + + case MXDM_GETDEVCAPS: + break; + + case MXDM_OPEN: + break; + + case MXDM_CLOSE: + break; + + case MXDM_GETLINEINFO: + break; + + case MXDM_GETLINECONTROLS: + break; + + case MXDM_GETCONTROLDETAILS: + break; + + case MXDM_SETCONTROLDETAILS: + break; + } + return MMSYSERR_NOTSUPPORTED; } @@ -31,6 +66,30 @@ DWORD dwParam1, DWORD dwParam2) { + DPRINT1("auxMessage(%04X, %04X, %08X, %08X, %08X);\n", uDevice, uMsg, dwUser, dwParam1, dwParam2); + + switch (uMsg) + { + case AUXDM_GETDEVCAPS: + + break; + + case AUXDM_GETNUMDEVS: + + break; + + case AUXDM_GETVOLUME: + + break; + + case AUXDM_SETVOLUME: + + break; + + default: + return MMSYSERR_NOTSUPPORTED; + } + return MMSYSERR_NOTSUPPORTED; } @@ -41,6 +100,62 @@ DWORD dwParam1, DWORD dwParam2) { + DPRINT1("wodMessage(%04X, %04X, %08X, %08X, %08X);\n", uDevice, uMsg, dwUser, dwParam1, dwParam2); + + switch (uMsg) + { + case WODM_GETNUMDEVS: + break; + + case WODM_GETDEVCAPS: + break; + + case WODM_OPEN: + break; + + case WODM_CLOSE: + break; + + case WODM_WRITE: + break; + + case WODM_PAUSE: + break; + + case WODM_RESTART: + break; + + case WODM_RESET: + break; + + case WODM_BREAKLOOP: + break; + + case WODM_GETPOS: + break; + + case WODM_SETPITCH: + break; + + case WODM_SETVOLUME: + break; + + case WODM_SETPLAYBACKRATE: + break; + + case WODM_GETPITCH: + break; + + case WODM_GETVOLUME: + break; + + case WODM_GETPLAYBACKRATE: + break; + + default: + return MMSYSERR_NOTSUPPORTED; + } + return MMSYSERR_NOTSUPPORTED; } @@ -51,6 +166,41 @@ DWORD dwParam1, DWORD dwParam2) { + DPRINT1("widMessage(%04X, %04X, %08X, %08X, %08X);\n", uDevice, uMsg, dwUser, dwParam1, dwParam2); + + switch (uMsg) + { + case WIDM_GETNUMDEVS: + break; + + case WIDM_GETDEVCAPS: + break; + + case WIDM_OPEN: + break; + + case WIDM_CLOSE: + break; + + case WIDM_ADDBUFFER: + break; + + case WIDM_STOP: + break; + + case WIDM_START: + break; + + case WIDM_RESET: + break; + + case WIDM_GETPOS: + break; + + default: + return MMSYSERR_NOTSUPPORTED; + } + return MMSYSERR_NOTSUPPORTED; } @@ -61,6 +211,8 @@ DWORD dwParam1, DWORD dwParam2) { + DPRINT1("modMessage(%04X, %04X, %08X, %08X, %08X);\n", uDevice, uMsg, dwUser, dwParam1, dwParam2); + return MMSYSERR_NOTSUPPORTED; } Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild [iso-8859-1] Sun May 25 05:41:08 2008 @@ -1,4 +1,4 @@ -<module name="wdmaud.drv" type="win32dll" baseaddress="${BASEADDRESS_RASDLG}" installbase="system32" installname="wdmaud.drv"> +<module name="wdmaud.drv" type="win32dll" baseaddress="${BASEADDRESS_WDMAUD}" installbase="system32" installname="wdmaud.drv"> <importlibrary definition="wdmaud.def" /> <include base="wdmaud.drv">.</include> <define name="_DISABLE_TIDENTS" />
16 years, 5 months
1
0
0
0
[dchapyshev] 33693: - Add baseaddress for wdmaud.drv
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun May 25 05:39:34 2008 New Revision: 33693 URL:
http://svn.reactos.org/svn/reactos?rev=33693&view=rev
Log: - Add baseaddress for wdmaud.drv Modified: trunk/reactos/baseaddress.rbuild Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=336…
============================================================================== --- trunk/reactos/baseaddress.rbuild [iso-8859-1] (original) +++ trunk/reactos/baseaddress.rbuild [iso-8859-1] Sun May 25 05:39:34 2008 @@ -89,6 +89,7 @@ <property name="BASEADDRESS_WINFAX" value="0x722C0000" /> <property name="BASEADDRESS_WINSCARD" value="0x723d0000" /> <property name="BASEADDRESS_DEVMGR" value="0x72a90000" /> + <property name="BASEADDRESS_WDMAUD" value="0x72d20000" /> <property name="BASEADDRESS_WINSPOOL" value="0x72f50000" /> <property name="BASEADDRESS_MSDMO" value="0x73670000" /> <property name="BASEADDRESS_AVIFIL32" value="0x73ac0000" />
16 years, 5 months
1
0
0
0
[silverblade] 33692: Added NTDDSND.H which defines IOCTL codes, structures and other definitions for NT4 style audio drivers. Cleaned out sb16_nt4 directory in preparation of rewrite.
by silverblade@svn.reactos.org
Author: silverblade Date: Sun May 25 05:32:57 2008 New Revision: 33692 URL:
http://svn.reactos.org/svn/reactos?rev=33692&view=rev
Log: Added NTDDSND.H which defines IOCTL codes, structures and other definitions for NT4 style audio drivers. Cleaned out sb16_nt4 directory in preparation of rewrite. Added: branches/silverblade-audio/include/ddk/ntddsnd.h (with props) Removed: branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/control.c branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/interrupt.c branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/main.c branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sndblst.h Modified: branches/silverblade-audio/drivers/multimedia/audio/directory.rbuild branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sb16_nt4.def branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sb16_nt4.rbuild Modified: branches/silverblade-audio/drivers/multimedia/audio/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/drivers/multi…
============================================================================== --- branches/silverblade-audio/drivers/multimedia/audio/directory.rbuild [iso-8859-1] (original) +++ branches/silverblade-audio/drivers/multimedia/audio/directory.rbuild [iso-8859-1] Sun May 25 05:32:57 2008 @@ -1,11 +1,12 @@ <?xml version="1.0"?> <!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd"> <group xmlns:xi="
http://www.w3.org/2001/XInclude
"> + <directory name="sb16_nt4"> + <xi:include href="sb16_nt4/sb16_nt4.rbuild" /> + </directory> + <!--directory name="mpu401_nt4"> <xi:include href="mpu401_nt4/mpu401.rbuild" /> - </directory> - <directory name="sb16_nt4"> - <xi:include href="sb16_nt4/sb16_nt4.rbuild" /> </directory> <directory name="sndblst"> <xi:include href="sndblst/sndblst.rbuild" /> Removed: branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/control.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/drivers/multi…
============================================================================== --- branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/control.c [iso-8859-1] (original) +++ branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/control.c (removed) @@ -1,222 +1,0 @@ -#include <sndblst.h> - -/* - TODO: MmMapIoSpace() -*/ - -/* - This checks the read or write status port of the device. -*/ - -BOOLEAN -WaitForReady( - PSOUND_BLASTER_PARAMETERS SBDevice, - UCHAR Port) -{ - ULONG timeout = SB_TIMEOUT; - BOOL ready = FALSE; - - while ( ( ! ready ) && ( timeout > 0 ) ) - { - if ( SbRead(SBDevice, Port) & 0x80 ) - return TRUE; - - timeout --; - } - - return FALSE; -} - -BOOLEAN -SbWriteData( - PSOUND_BLASTER_PARAMETERS SBDevice, - UCHAR Data) -{ - if ( ! WaitToWrite(SBDevice) ) - return FALSE; - - DPRINT("Writing 0x%x to Sound Blaster card (data)\n", Data); - SbWrite(SBDevice, SB_WRITE_DATA_PORT, Data); - - return TRUE; -} - -BOOLEAN -SbReadData( - PSOUND_BLASTER_PARAMETERS SBDevice, - PUCHAR Data) -{ - if ( ! WaitToWrite(SBDevice) ) - return FALSE; - - *Data = SbRead(SBDevice, SB_READ_DATA_PORT); - DPRINT("Read 0x%x from Sound Blaster card (data)\n", *Data); - - return TRUE; -} - -BOOLEAN -ResetSoundBlaster( - PSOUND_BLASTER_PARAMETERS SBDevice) -{ - BOOLEAN acked = FALSE; - ULONG timeout; - - SbWriteReset(SBDevice, 0x01); - for (timeout = 0; timeout < 30000; timeout ++ ); - SbWriteReset(SBDevice, 0x00); - - DPRINT("Waiting for SB to acknowledge our reset request\n"); - - if ( ! WaitToRead(SBDevice) ) - { - DPRINT("Didn't get an ACK :(\n"); - return FALSE; - } - - timeout = 0; - - while ( ( ! acked ) && ( timeout < SB_TIMEOUT ) ) - { - acked = ( SbReadDataWithoutWait(SBDevice) == SB_DSP_READY ); - timeout ++; - } - - if ( ! acked ) - { - DPRINT("Didn't get an ACK :(\n"); - return FALSE; - } - - return TRUE; -} - -ULONG -GetSoundBlasterModel( - PSOUND_BLASTER_PARAMETERS SBDevice) -{ - UCHAR MajorVer, MinorVer; - - DPRINT("Querying DSP version\n"); - - if ( ! SbWriteData(SBDevice, SbGetDspVersion) ) - return NotDetected; - - if ( ! WaitToRead(SBDevice) ) - return NotDetected; - - if ( SbReadData(SBDevice, &MajorVer) ) - { - if ( SbReadData(SBDevice, &MinorVer) ) - { - DPRINT("Version %d.%d\n", MajorVer, MinorVer); - - SBDevice->dsp_version = (MajorVer * 256) + MinorVer; - - if ( SBDevice->dsp_version < 0x0200 ) - return SoundBlaster; - else if ( ( SBDevice->dsp_version & 0xFF00 ) == 0x0200 ) - return SoundBlaster2; - else if ( ( SBDevice->dsp_version & 0xFF00 ) == 0x0300 ) - return SoundBlasterPro; - else if ( SBDevice->dsp_version >= 0x0400 ) - return SoundBlaster16; - - return NotDetected; - } - } - - return NotDetected; -} - - -BOOLEAN -IsSampleRateCompatible( - PSOUND_BLASTER_PARAMETERS SBDevice, - ULONG SampleRate) -{ - /* TODO */ - return TRUE; -} - -BOOLEAN -SetOutputSampleRate( - PSOUND_BLASTER_PARAMETERS SBDevice, - ULONG SampleRate) -{ - /* Only works for DSP v4.xx */ - DPRINT("Setting sample rate\n"); - - SbWriteData(SBDevice, SbSetOutputRate); - SbWriteData(SBDevice, SampleRate / 256); - SbWriteData(SBDevice, SampleRate % 256); - - return TRUE; -} - -BOOLEAN -EnableSpeaker( - PSOUND_BLASTER_PARAMETERS SBDevice) -{ - DPRINT("Enabling speaker\n"); - - return SbWriteData(SBDevice, SbEnableSpeaker); -} - -BOOLEAN -DisableSpeaker( - PSOUND_BLASTER_PARAMETERS SBDevice) -{ - DPRINT("Disabling speaker\n"); - - return SbWriteData(SBDevice, SbDisableSpeaker); -} - -BOOLEAN -StartSoundOutput( - PSOUND_BLASTER_PARAMETERS SBDevice, - ULONG BitDepth, - ULONG Channels, - ULONG BlockSize) -{ - DPRINT("Initializing output with %d channels at %d bits/sample\n", Channels, BitDepth); - - UCHAR command = 0xc6, mode = 0x00; - - if ( ( Channels < 1 ) || ( Channels > 2 ) ) - return FALSE; - - if ( ( BitDepth != 8 ) && ( BitDepth != 16 ) ) - return FALSE; - - switch ( BitDepth ) - { - case 8 : command = 0xc6; break; - case 16 : command = 0xb6; break; - }; - - switch ( Channels ) - { - case 1 : mode = 0x00; break; - case 2 : mode = 0x20; break; - } -#if 0 - first_byte = (BitDepth == 16) ? 0xb6 : 0xc6; - second_byte = (Channels == 1) ? 0x20 : 0x00; -#endif - - if ( SBDevice->dsp_version < 0x0400 ) - { - /* TODO: Additional programming required */ - } - - /* Send freq */ - SbWriteData(SBDevice, command); - SbWriteData(SBDevice, mode); - SbWriteData(SBDevice, BlockSize % 256); - SbWriteData(SBDevice, BlockSize / 256); - - DPRINT("Finished programming the DSP\n"); - - return TRUE; -} Removed: branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/interrupt.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/drivers/multi…
============================================================================== --- branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/interrupt.c [iso-8859-1] (original) +++ branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/interrupt.c (removed) @@ -1,61 +1,0 @@ -/* -*/ - -#include <sndblst.h> - -BOOLEAN -CheckIrq( - PDEVICE_OBJECT DeviceObject) -{ -/* PSOUND_BLASTER_PARAMETERS parameters = DeviceObject->DriverExtension;*/ - - /* TODO */ - - return TRUE; -} - -BOOLEAN NTAPI -ServiceSoundBlasterInterrupt( - IN PKINTERRUPT Interrupt, - IN PVOID Context) -{ - DPRINT("* Processing ISR *\n"); - return FALSE; -} - -NTSTATUS -EnableIrq( - PDEVICE_OBJECT DeviceObject) -{ - PSOUND_BLASTER_PARAMETERS parameters = DeviceObject->DeviceExtension; - ULONG vector; - KIRQL irq_level; - KAFFINITY affinity; - NTSTATUS status = STATUS_SUCCESS; - - vector = HalGetInterruptVector(Isa, - 0, - parameters->irq, - parameters->irq, - &irq_level, - &affinity); - - DPRINT("Vector is 0x%x\n", vector); - - status = IoConnectInterrupt(¶meters->interrupt, - ServiceSoundBlasterInterrupt, - DeviceObject, - (PKSPIN_LOCK) NULL, - vector, - irq_level, - irq_level, - Latched, /* Latched / LevelSensitive */ - FALSE, /* shareable */ - affinity, - FALSE); - - if ( status == STATUS_INVALID_PARAMETER ) - status = STATUS_DEVICE_CONFIGURATION_ERROR; - - return status; -} Removed: branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/main.c URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/drivers/multi…
============================================================================== --- branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/main.c [iso-8859-1] (original) +++ branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/main.c (removed) @@ -1,491 +1,0 @@ -/* - ReactOS - Sound Blaster driver - - Programmers: - Andrew Greenwood - - Notes: - Compatible with NT4 -*/ - -#define NDEBUG -#include <sndblst.h> - -#define TAG(A, B, C, D) (IN ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) - -/* - IRP DISPATCH ROUTINES -*/ - -NTSTATUS STDCALL -CreateSoundBlaster( - PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - PSOUND_BLASTER_PARAMETERS sb_device = DeviceObject->DeviceExtension; - - DPRINT("CreateSoundBlaster() called - extension 0x%x\n", sb_device); - - EnableSpeaker(sb_device); - /*SetOutputSampleRate(sb_device, 22*/ - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return STATUS_SUCCESS; -} - -NTSTATUS STDCALL -CloseSoundBlaster( - PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - //PSOUND_BLASTER_PARAMETERS sb_device = DeviceObject->DeviceExtension; - - DPRINT("CloseSoundBlaster() called\n"); - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return STATUS_SUCCESS; -} - -NTSTATUS STDCALL -CleanupSoundBlaster( - PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - //PSOUND_BLASTER_PARAMETERS sb_device = DeviceObject->DeviceExtension; - - DPRINT("CleanupSoundBlaster() called\n"); - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return STATUS_SUCCESS; -} - -NTSTATUS STDCALL -ControlSoundBlaster( - PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - PIO_STACK_LOCATION stack; - //PSOUND_BLASTER_PARAMETERS sb_device = DeviceObject->DeviceExtension; - - DPRINT("ControlSoundBlaster() called\n"); - - stack = IoGetCurrentIrpStackLocation(Irp); - - switch ( stack->Parameters.DeviceIoControl.IoControlCode) - { - /* TODO */ - }; - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return STATUS_SUCCESS; -} - -NTSTATUS STDCALL -WriteSoundBlaster( - PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - //PSOUND_BLASTER_PARAMETERS sb_device = DeviceObject->DeviceExtension; - - DPRINT("WriteSoundBlaster() called\n"); - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return STATUS_SUCCESS; -} - -VOID STDCALL -UnloadSoundBlaster( - PDRIVER_OBJECT DriverObject) -{ - DPRINT("Sound Blaster driver unload\n"); -} - -NTSTATUS STDCALL -OpenSubkey( - PUNICODE_STRING RegistryPath, - PWSTR Subkey, - ACCESS_MASK DesiredAccess, - OUT HANDLE* DevicesKeyHandle) -{ - NTSTATUS status; - OBJECT_ATTRIBUTES attribs; - UNICODE_STRING subkey_name; - HANDLE key_handle; - - /* TODO: Check for NULL ptr in DevicesKeyHandle */ - - InitializeObjectAttributes(&attribs, - RegistryPath, - OBJ_CASE_INSENSITIVE, - NULL, - (PSECURITY_DESCRIPTOR) NULL); - - status = ZwOpenKey(&key_handle, KEY_READ, &attribs); - - if ( ! NT_SUCCESS(status) ) - { - DPRINT("Couldn't open subkey %wZ\n", Subkey); - return status; - } - - RtlInitUnicodeString(&subkey_name, Subkey); - - InitializeObjectAttributes(&attribs, - &subkey_name, - OBJ_CASE_INSENSITIVE, - key_handle, - (PSECURITY_DESCRIPTOR) NULL); - - status = ZwOpenKey(*DevicesKeyHandle, DesiredAccess, &attribs); - ZwClose(key_handle); - - return status; -} - - -PWSTR STDCALL -AllocateRegistryPathInfo( - PUNICODE_STRING BasePath, - PUNICODE_STRING ParametersPath, - PKEY_BASIC_INFORMATION KeyInfo) -{ - PWSTR name; - PWSTR pos; - - DPRINT("Allocating memory for path info\n"); - name = ExAllocatePool(PagedPool, - BasePath->Length + sizeof(WCHAR) + - ParametersPath->Length + sizeof(WCHAR) + - KeyInfo->NameLength + sizeof(UNICODE_NULL)); - - if ( ! name ) - return NULL; - - DPRINT("Copying info\n"); - pos = name; - - RtlCopyMemory((PVOID)Pos, (PVOID)BasePath->Buffer, BasePath->Length); - pos += BasePath->Length / sizeof(WCHAR); - pos[0] = '\\'; - pos ++; - - RtlCopyMemory((PVOID)Pos, (PVOID)ParametersPath->Buffer, ParametersPath->Length); - pos += ParametersPath->Length / sizeof(WCHAR); - pos[0] = '\\'; - pos ++; - - RtlCopyMemory((PVOID)Pos, (PVOID)ParametersPath->Buffer, ParametersPath->Length); - pos += KeyInfo->NameLength / sizeof(WCHAR); - pos[0] = UNICODE_NULL; - - DPRINT("All OK\n"); - return name; -} - -#define FreeRegistryPathInfo(ptr) \ - ExFreePool(ptr) - - -#define TAG_REG_INFO TAG('I','g','e','R') -#define TAG_REG_NAME TAG('N','g','e','R') - -NTSTATUS STDCALL -EnumerateSubkey( - PUNICODE_STRING RegistryPath, - PWSTR Subkey, - PREGISTRY_CALLBACK_ROUTINE Callback, - PDRIVER_OBJECT DriverObject) -{ - NTSTATUS status; - UNICODE_STRING subkey_name; - HANDLE devices_key_handle; - - ULONG key_index = 0; - ULONG result_length; - - status = OpenSubkey(RegistryPath, Subkey, KEY_ENUMERATE_SUB_KEYS, &devices_key_handle); - - if ( ! NT_SUCCESS(status) ) - return status; - - while ( TRUE ) - { - KEY_BASIC_INFORMATION test_info; - PKEY_BASIC_INFORMATION info; - ULONG size; - PWSTR name; - - status = ZwEnumerateKey(devices_key_handle, - key_index, - KeyBasicInformation, - &test_info, - sizeof(test_info), - &result_length); - - if ( status == STATUS_NO_MORE_ENTRIES ) - break; - - size = result_length + FIELD_OFFSET(KEY_BASIC_INFORMATION, Name[0]); - - info = (PKEY_BASIC_INFORMATION) ExAllocatePoolWithTag(PagedPool, size, TAG_REG_INFO); - - if ( ! info ) - { - DPRINT("Out of memory\n"); - status = STATUS_INSUFFICIENT_RESOURCES; - break; - } - - status = ZwEnumerateKey(devices_key_handle, - key_index, - KeyBasicInformation, - info, - size, - &result_length); - - if ( ! NT_SUCCESS(status) ) - { - DPRINT("Unable to enumerate keys\n"); - ExFreePoolWithTag(info, TAG_REG_INFO); - status = STATUS_INTERNAL_ERROR; - break; - } - - /* Is this ok? */ - RtlInitUnicodeString(&subkey_name, Subkey); - - name = AllocateRegistryPathInfo(RegistryPath, &subkey_name, info); - - if ( ! name ) - { - DPRINT("Out of memory\n"); - ExFreePoolWithTag(info, TAG_REG_INFO); - status = STATUS_INSUFFICIENT_RESOURCES; - break; - } - - ExFreePoolWithTag(info, TAG_REG_INFO); - - /* Call the callback */ - status = Callback(DriverObject, name); - - FreeRegistryPathInfo(name); - - if ( ! NT_SUCCESS(status) ) - { - DPRINT("Callback FAILED\n"); - break; - } - - key_index ++; - } - - ZwClose(devices_key_handle); - - DPRINT("Found %d subkey entries\n", key_index); - - if ( ( key_index == 0 ) && ( status == STATUS_NO_MORE_ENTRIES ) ) - return STATUS_DEVICE_CONFIGURATION_ERROR; - - if ( status == STATUS_NO_MORE_ENTRIES ) - status = STATUS_SUCCESS; - - return status; -} - -#define EnumerateDeviceKeys(path, callback, driver_obj) \ - EnumerateSubkey(path, L"Devices", callback, driver_obj) - - -NTSTATUS -CreateDeviceName( - PCWSTR PrePrefix, - PCWSTR Prefix, - UCHAR Index, - PUNICODE_STRING DeviceName) -{ - UNICODE_STRING number; - WCHAR number_buffer[5]; - UNICODE_STRING unicode_pre_prefix; - UNICODE_STRING unicode_prefix; - ULONG size; - - RtlInitUnicodeString(&unicode_pre_prefix, PrePrefix); - RtlInitUnicodeString(&unicode_prefix, Prefix); - - size = unicode_pre_prefix.Length + - unicode_prefix.Length + - sizeof(number_buffer) + - sizeof(UNICODE_NULL); - - DeviceName->Buffer = ExAllocatePool(PagedPool, size); - DeviceName->MaximumLength = (USHORT) size; - - if ( ! DeviceName->Buffer ) - return STATUS_INSUFFICIENT_RESOURCES; - - RtlCopyUnicodeString(DeviceName, &unicode_pre_prefix); - RtlAppendUnicodeStringToString(DeviceName, &unicode_prefix); - - if ( Index != 255 ) - { - number.Buffer = number_buffer; - number.MaximumLength = sizeof(number_buffer); - - RtlIntegerToUnicodeString((ULONG) Index, 10, &number); - RtlAppendUnicodeStringToString(DeviceName, &number); - } - - DeviceName->Buffer[DeviceName->Length / sizeof(UNICODE_NULL)] = UNICODE_NULL; - - return STATUS_SUCCESS; -} - -NTSTATUS STDCALL -InitializeSoundBlaster( - PDRIVER_OBJECT DriverObject, - PWSTR RegistryPath) -{ - NTSTATUS status; - PDEVICE_OBJECT device_object; - PSOUND_BLASTER_PARAMETERS parameters = NULL; - UNICODE_STRING device_name; - UNICODE_STRING dos_device_name; - - UCHAR device_index = 0; - - DPRINT("Initializing a Sound Blaster device\n"); - - /* Change these later */ - status = CreateDeviceName(L"", - L"\\Device\\WaveOut", - device_index, - &device_name); - - if ( ! NT_SUCCESS(status) ) - return status; - - status = CreateDeviceName(L"\\DosDevices\\", - L"\\Device\\WaveOut" + wcslen(L"\\Device\\"), - device_index, - &dos_device_name); - - if ( ! NT_SUCCESS(status) ) - { - /* TODO */ - return status; - } - - DPRINT("Device: %wZ\n", device_name); - DPRINT("Symlink: %wZ\n", dos_device_name); - - /* - Create the device and DOS symlink - */ - - status = IoCreateDevice(DriverObject, - sizeof(SOUND_BLASTER_PARAMETERS), - &device_name, - FILE_DEVICE_SOUND, - 0, - FALSE, - &device_object); - - if ( ! NT_SUCCESS(status) ) - return status; - - DPRINT("Created a device extension at 0x%x\n", device_object->DeviceExtension); - parameters = device_object->DeviceExtension; - - status = IoCreateSymbolicLink(&dos_device_name, &device_name); - - ExFreePool(dos_device_name.Buffer); - ExFreePool(device_name.Buffer); - - if ( ! NT_SUCCESS(status) ) - { - IoDeleteDevice(device_object); - device_object = NULL; - return status; - } - - /* IoRegisterShutdownNotification( */ - - /* - Settings - */ - - device_object->AlignmentRequirement = FILE_BYTE_ALIGNMENT; - - parameters->driver = DriverObject; - parameters->registry_path = RegistryPath; - parameters->port = DEFAULT_PORT; - parameters->irq = DEFAULT_IRQ; - parameters->dma = DEFAULT_DMA; - parameters->buffer_size = DEFAULT_BUFFER_SIZE; - - /* TODO: Load the settings from the registry */ - - DPRINT("Port %x IRQ %d DMA %d\n", parameters->port, parameters->irq, parameters->dma); - - DPRINT("Resetting the sound card\n"); - - if ( ! ResetSoundBlaster(parameters) ) - { - /* TODO */ - return STATUS_UNSUCCESSFUL; - } - - /* - DPRINT("What kind of SB card is this?\n"); - GetSoundBlasterModel(parameters); - */ - - return STATUS_SUCCESS; -} - - -NTSTATUS STDCALL -DriverEntry( - PDRIVER_OBJECT DriverObject, - PUNICODE_STRING RegistryPath) -{ - NTSTATUS status; - - DPRINT("Sound Blaster driver 0.1 by Silver Blade\n"); - - DriverObject->Flags = 0; - DriverObject->MajorFunction[IRP_MJ_CREATE] = CreateSoundBlaster; - DriverObject->MajorFunction[IRP_MJ_CLOSE] = CloseSoundBlaster; - DriverObject->MajorFunction[IRP_MJ_CLEANUP] = CleanupSoundBlaster; - DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = ControlSoundBlaster; - DriverObject->MajorFunction[IRP_MJ_WRITE] = WriteSoundBlaster; - DriverObject->DriverUnload = UnloadSoundBlaster; - - DPRINT("Beginning device key enumeration\n"); - - status = EnumerateDeviceKeys(RegistryPath, *InitializeSoundBlaster, DriverObject); - - return status; -} Modified: branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sb16_nt4.def URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/drivers/multi…
============================================================================== --- branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sb16_nt4.def [iso-8859-1] (original) +++ branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sb16_nt4.def [iso-8859-1] Sun May 25 05:32:57 2008 @@ -1,5 +1,5 @@ ; -; Exports definition file for sb16_ks.sys +; Exports definition file for NT4 Sound Blaster driver ; EXPORTS DriverEntry@8 Modified: branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sb16_nt4.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/drivers/multi…
============================================================================== --- branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sb16_nt4.rbuild [iso-8859-1] (original) +++ branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sb16_nt4.rbuild [iso-8859-1] Sun May 25 05:32:57 2008 @@ -6,7 +6,5 @@ <importlibrary definition="sb16_nt4.def" /> <library>ntoskrnl</library> <library>hal</library> - <file>main.c</file> - <file>control.c</file> - <file>interrupt.c</file> + <file>test.c</file> </module> Removed: branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sndblst.h URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/drivers/multi…
============================================================================== --- branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sndblst.h [iso-8859-1] (original) +++ branches/silverblade-audio/drivers/multimedia/audio/sb16_nt4/sndblst.h (removed) @@ -1,155 +1,0 @@ -#ifndef SNDBLST_H -#define SNDBLST_H - -#include <debug.h> -#include <ntddk.h> - -#define SB_WAVE_IN_DEVICE_NAME L"\\Device\\SBWaveIn" -#define SB_WAVE_OUT_DEVICE_NAME L"\\Device\\SBWaveOut" -/* TODO: MIDI */ -#define SB_AUX_DEVICE_NAME L"\\Device\\SBAux" -#define SB_MIXER_DEVICE_NAME L"\\Device\\SBMixer" - -#define DEFAULT_PORT 0x220 -#define DEFAULT_IRQ 5 -#define DEFAULT_DMA 1 -#define DEFAULT_BUFFER_SIZE 65535 - -#define SB_TIMEOUT 1000000 - -#define SB_DSP_READY 0xaa - -enum -{ - NotDetected, - SoundBlaster, - SoundBlasterPro, - SoundBlaster2, - SoundBlasterPro2, - SoundBlasterProMCV, - SoundBlaster16 -}; - -enum -{ - SB_RESET_PORT = 0x06, - SB_READ_DATA_PORT = 0x0a, - SB_WRITE_DATA_PORT = 0x0c, - SB_WRITE_STATUS_PORT = 0x0c, - SB_READ_STATUS_PORT = 0x0e -}; - -enum -{ - SbAutoInitDmaOutput = 0x1c, - SbAutoInitDmaInput = 0x2c, - SbSetOutputRate = 0x41, /* DSP v4.xx */ - SbSetInputRate = 0x42, /* DSP v4.xx */ - SbSetBlockSize = 0x48, /* DSP v2.00 + */ - SbPauseDac = 0x80, - SbPauseDmaOutput = 0xd0, - SbEnableSpeaker = 0xd1, - SbDisableSpeaker = 0xd3, - SbGetSpeakerStatus = 0xd8, /* DSP v2.00 + */ - SbGetDspVersion = 0xe1 -}; - -typedef struct _SOUND_BLASTER_PARAMETERS -{ - PDRIVER_OBJECT driver; - PWSTR registry_path; - PKINTERRUPT interrupt; - ULONG port; - ULONG irq; - ULONG dma; - ULONG buffer_size; - USHORT dsp_version; -} SOUND_BLASTER_PARAMETERS, *PSOUND_BLASTER_PARAMETERS; - - -typedef STDCALL NTSTATUS REGISTRY_CALLBACK_ROUTINE(PDRIVER_OBJECT DriverObject, PWSTR RegistryPath); -typedef REGISTRY_CALLBACK_ROUTINE *PREGISTRY_CALLBACK_ROUTINE; - - -/* - Port I/O -*/ - -#define SbWrite(sbdevice, subport, data) \ - WRITE_PORT_UCHAR((PUCHAR) sbdevice->port + subport, data) - -#define SbRead(sbdevice, subport) \ - READ_PORT_UCHAR((PUCHAR) sbdevice->port + subport) - -#define SbWriteReset(sbdevice, data) \ - SbWrite(sbdevice, SB_RESET_PORT, data) - -#define SbWriteDataWithoutWait(sbdevice, data) \ - SbWrite(sbdevice, SB_WRITE_DATA_PORT, data) - -#define SbReadDataWithoutWait(sbdevice) \ - SbRead(sbdevice, SB_READ_DATA_PORT) - - -#define SbGetWriteStatus(sbdevice) \ - SbRead(sbdevice, SB_WRITE_STATUS_PORT) - -#define SbGetReadStatus(sbdevice) \ - SbRead(sbdevice, SB_READ_STATUS_PORT) - - - -BOOLEAN -WaitForReady( - PSOUND_BLASTER_PARAMETERS SBDevice, - UCHAR Port); - -#define WaitToWrite(sbdevice) \ - WaitForReady(sbdevice, SB_WRITE_STATUS_PORT) - -#define WaitToRead(sbdevice) \ - WaitForReady(sbdevice, SB_READ_STATUS_PORT) - -BOOLEAN -ResetSoundBlaster( - PSOUND_BLASTER_PARAMETERS SBDevice); - -ULONG -GetSoundBlasterModel( - PSOUND_BLASTER_PARAMETERS SBDevice); - -BOOLEAN -IsSampleRateCompatible( - PSOUND_BLASTER_PARAMETERS SBDevice, - ULONG SampleRate); - -BOOLEAN -SetOutputSampleRate( - PSOUND_BLASTER_PARAMETERS SBDevice, - ULONG SampleRate); - -BOOLEAN -EnableSpeaker( - PSOUND_BLASTER_PARAMETERS SBDevice); - -BOOLEAN -DisableSpeaker( - PSOUND_BLASTER_PARAMETERS SBDevice); - -BOOLEAN -StartSoundOutput( - PSOUND_BLASTER_PARAMETERS SBDevice, - ULONG BitDepth, - ULONG Channels, - ULONG BlockSize); - - -/* - interrupt.c -*/ - -NTSTATUS -EnableIrq( - PDEVICE_OBJECT DeviceObject); - -#endif Added: branches/silverblade-audio/include/ddk/ntddsnd.h URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/include/ddk/n…
============================================================================== --- branches/silverblade-audio/include/ddk/ntddsnd.h (added) +++ branches/silverblade-audio/include/ddk/ntddsnd.h [iso-8859-1] Sun May 25 05:32:57 2008 @@ -1,0 +1,322 @@ +/* + ReactOS Sound System + NT4 Multimedia Audio Support (ntddsnd.h) + + Author: + Andrew Greenwood (andrew.greenwood(a)silverblade.co.uk) + + History: + 24 May 2008 - Created + + This file contains definitions and structures for Windows NT4 style + multimedia drivers. The NT4 DDK has these split across multiple header + files: NTDDSND.H, NTDDWAVE.H, NTDDMIDI.H, NTDDMIX.H and NTDDAUX.H + + Should you have an unstoppable urge to build an NT4 multimedia driver + against these headers, just create the other files listed above and make + them #include this one. +*/ + +#ifndef NTDDWAVE +#define NTDDWAVE + +#define SOUND_MAX_DEVICES 100 + + +/* + Base device names + + Each device name should be given a numerical suffix identifying that + unique device, eg: + + \Device\WaveOut0 - First wave output device + \Device\WaveOut1 - Second wave output device +*/ + +#define SOUND_MAX_DEVICE_NAME 80 + +#define DD_WAVE_IN_DEVICE_NAME "\\Device\\WaveIn" +#define DD_WAVE_IN_DEVICE_NAME_U L"\\Device\\WaveIn" + +#define DD_WAVE_OUT_DEVICE_NAME "\\Device\\WaveOut" +#define DD_WAVE_OUT_DEVICE_NAME_U L"\\Device\\WaveOut" + +#define DD_MIDI_IN_DEVICE_NAME "\\Device\\MidiIn" +#define DD_MIDI_IN_DEVICE_NAME_U L"\\Device\\MidiIn" + +#define DD_MIDI_OUT_DEVICE_NAME "\\Device\\MidiOut" +#define DD_MIDI_OUT_DEVICE_NAME_U L"\\Device\\MidiOut" + +#define DD_MIX_DEVICE_NAME "\\Device\\MMMix" +#define DD_MIX_DEVICE_NAME_U L"\\Device\\MMMix" + +#define DD_AUX_DEVICE_NAME "\\Device\\MMAux" +#define DD_AUX_DEVICE_NAME_U L"\\Device\\MMAux" + +/* + Base control codes +*/ + +#define IOCTL_SOUND_BASE FILE_DEVICE_SOUND +#define IOCTL_WAVE_BASE 0x0000 +#define IOCTL_MIDI_BASE 0x0080 +#define IOCTL_AUX_BASE 0x0100 +#define IOCTL_MIX_BASE 0x0180 + + +/* + Helper macros for defining control codes +*/ + +#define WAVE_CTL_CODE(subcode, iomethod, access) \ + CTL_CODE(FILE_DEVICE_SOUND, IOCTL_WAVE_BASE + subcode, iomethod, access) + +#define MIDI_CTL_CODE(subcode, iomethod, access) \ + CTL_CODE(FILE_DEVICE_SOUND, IOCTL_MIDI_BASE + subcode, iomethod, access) + +#define MIX_CTL_CODE(subcode, iomethod, access) \ + CTL_CODE(FILE_DEVICE_SOUND, IOCTL_MIX_BASE + subcode, iomethod, access) + +#define AUX_CTL_CODE(subcode, iomethod, access) \ + CTL_CODE(FILE_DEVICE_SOUND, IOCTL_AUX_BASE + subcode, iomethod, access) + + +/* + Wave device control codes +*/ + +#define IOCTL_WAVE_QUERY_FORMAT \ + WAVE_CTL_CODE(0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_WAVE_SET_FORMAT \ + WAVE_CTL_CODE(0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_GET_CAPABILITIES \ + WAVE_CTL_CODE(0x0003, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_WAVE_SET_STATE \ + WAVE_CTL_CODE(0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_GET_STATE \ + WAVE_CTL_CODE(0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_GET_POSITION \ + WAVE_CTL_CODE(0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_SET_VOLUME \ + WAVE_CTL_CODE(0x0007, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_WAVE_GET_VOLUME \ + WAVE_CTL_CODE(0x0008, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_WAVE_SET_PITCH \ + WAVE_CTL_CODE(0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_GET_PITCH \ + WAVE_CTL_CODE(0x000A, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_SET_PLAYBACK_RATE \ + WAVE_CTL_CODE(0x000B, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_GET_PLAYBACK_RATE \ + WAVE_CTL_CODE(0x000C, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_PLAY \ + WAVE_CTL_CODE(0x000D, METHOD_IN_DIRECT, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_RECORD \ + WAVE_CTL_CODE(0x000E, METHOD_OUT_DIRECT, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_BREAK_LOOP \ + WAVE_CTL_CODE(0x000F, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_WAVE_SET_LOW_PRIORITY \ + WAVE_CTL_CODE(0x0010, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#if DBG + /* Debug-only control code */ + #define IOCTL_WAVE_SET_DEBUG_LEVEL \ + WAVE_CTL_CODE(0x0040, METHOD_BUFFERED, FILE_READ_ACCESS) +#endif + + +/* + MIDI device control codes +*/ + +#define IOCTL_MIDI_GET_CAPABILITIES \ + MIDI_CTL_CODE(0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_MIDI_SET_STATE \ + MIDI_CTL_CODE(0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_MIDI_GET_STATE \ + MIDI_CTL_CODE(0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_MIDI_SET_VOLUME \ + MIDI_CTL_CODE(0x0004, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_MIDI_GET_VOLUME \ + MIDI_CTL_CODE(0x0005, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_MIDI_PLAY \ + MIDI_CTL_CODE(0x0006, METHOD_NEITHER, FILE_WRITE_ACCESS) + +#define IOCTL_MIDI_RECORD \ + MIDI_CTL_CODE(0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_MIDI_CACHE_PATCHES \ + MIDI_CTL_CODE(0x0008, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#define IOCTL_MIDI_CACHE_DRUM_PATCHES \ + MIDI_CTL_CODE(0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS) + +#if DBG + /* Debug-only control code */ + #define IOCTL_MIDI_SET_DEBUG_LEVEL \ + WAVE_CTL_CODE(0x0040, METHOD_BUFFERED, FILE_READ_ACCESS) +#endif + + +/* + Mixer device control codes +*/ + +#define IOCTL_MIX_GET_CONFIGURATION \ + MIX_CTL_CODE(0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_MIX_GET_CONTROL_DATA \ + MIX_CTL_CODE(0x0002, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_MIX_GET_LINE_DATA \ + MIX_CTL_CODE(0x0003, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_MIX_REQUEST_NOTIFY \ + MIX_CTL_CODE(0x0004, METHOD_BUFFERED, FILE_READ_ACCESS) + + +/* + Auxiliary device control codes +*/ + +#define IOCTL_AUX_GET_CAPABILITIES \ + AUX_CTL_CODE(0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_AUX_SET_VOLUME \ + AUX_CTL_CODE(0x0002, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_AUX_GET_VOLUME \ + AUX_CTL_CODE(0x0003, METHOD_BUFFERED, FILE_READ_ACCESS) + +#define IOCTL_SOUND_GET_CHANGED_VOLUME \ + AUX_CTL_CODE(0x0004, METHOD_BUFFERED, FILE_READ_ACCESS) + + +/* + Wave structures & states +*/ + +#define WAVE_DD_MAX_VOLUME 0xFFFFFFFF + +typedef struct _WAVE_DD_VOLUME +{ + ULONG Left; + ULONG Right; +} WAVE_DD_VOLUME, *PWAVE_DD_VOLUME; + +typedef struct _WAVE_DD_PITCH +{ + ULONG Pitch; +} WAVE_DD_PITCH, *PWAVE_DD_PITCH; + +typedef struct _WAVE_DD_PLAYBACK_RATE +{ + ULONG Rate; +} WAVE_DD_PLAYBACK_RATE, *PWAVE_DD_PLAYBACK_RATE; + +/* IOCTL_WAVE_SET_STATE commands */ +#define WAVE_DD_STOP 0x0001 +#define WAVE_DD_PLAY 0x0002 +#define WAVE_DD_RECORD 0x0003 +#define WAVE_DD_RESET 0x0004 + +/* IOCTL_WAVE_GET_STATE responses */ +#define WAVE_DD_IDLE 0x0000 +#define WAVE_DD_STOPPED 0x0001 +#define WAVE_DD_PLAYING 0x0002 +#define WAVE_DD_RECORDING 0x0003 + + +/* + MIDI structures & states +*/ + +typedef struct _MIDI_DD_INPUT_DATA +{ + LARGE_INTEGER Time; + UCHAR Data[sizeof(ULONG)]; +} MIDI_DD_INPUT_DATA, *PMIDI_DD_INPUT_DATA; + +typedef struct _MIDI_DD_VOLUME +{ + ULONG Left; + ULONG Right; +} MIDI_DD_VOLUME, *PMIDI_DD_VOLUME; + +typedef struct _MIDI_DD_CACHE_PATCHES +{ + ULONG Bank; + ULONG Flags; + ULONG Patches[128]; +} MIDI_DD_CACHE_PATCHES, *PMIDI_DD_CACHE_PATCHES; + +typedef struct _MIDI_DD_CACHE_DRUM_PATCHES +{ + ULONG Patch; + ULONG Flags; + ULONG DrumPatches[128]; +} MIDI_DD_CACHE_DRUM_PATCHES, *PMIDI_DD_CACHE_DRUM_PATCHES; + +/* IOCTL_MIDI_SET_STATE commands */ +#define MIDI_DD_STOP 0x0001 +#define MIDI_DD_PLAY 0x0002 +#define MIDI_DD_RECORD 0x0003 +#define MIDI_DD_RESET 0x0004 + +/* IOCTL_MIDI_GET_STATE responses */ +#define MIDI_DD_IDLE 0x0000 +#define MIDI_DD_STOPPED 0x0001 +#define MIDI_DD_PLAYING 0x0002 +#define MIDI_DD_RECORDING 0x0003 + + +/* + Mixer structures + TODO: This is incomplete (see NTDDMIX.H in NT4 DDK) +*/ + +typedef struct _MIXER_DD_READ_DATA +{ + ULONG Id; +} MIXER_DD_READ_DATA, *PMIXER_DD_READ_DATA; + +typedef struct _MIXER_DD_LINE_DATA +{ + ULONG fdwLine; +} MIXER_DD_LINE_DATA, *PMIXER_DD_LINE_DATA; + + +/* + Auxiliary structures +*/ + +#define AUX_DD_MAX_VOLUME 0xFFFFFFFF + +typedef struct _AUX_DD_VOLUME +{ + ULONG Left; + ULONG Right; +} AUX_DD_VOLUME, *PAUX_DD_VOLUME; + + +#endif Propchange: branches/silverblade-audio/include/ddk/ntddsnd.h ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 5 months
1
0
0
0
[dchapyshev] 33691: - Add stubs WDM Audio driver mapper
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun May 25 04:34:14 2008 New Revision: 33691 URL:
http://svn.reactos.org/svn/reactos?rev=33691&view=rev
Log: - Add stubs WDM Audio driver mapper Added: trunk/reactos/dll/win32/wdmaud.drv/ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c (with props) trunk/reactos/dll/win32/wdmaud.drv/wdmaud.def (with props) trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild (with props) trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rc (with props) Modified: trunk/reactos/dll/win32/win32.rbuild Added: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c (added) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] Sun May 25 04:34:14 2008 @@ -1,0 +1,91 @@ +/* + * + * PROJECT: ReactOS WDM Audio driver mapper + * FILE: dll/win32/wdmaud.drv/wdmaud.c + * PURPOSE: wdmaud.drv + * PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org) + * + * UPDATE HISTORY: + * 25/05/2008 Created + */ + +#include <stdarg.h> + +#include <windows.h> +#include <mmsystem.h> + +DWORD APIENTRY +mxdMessage(UINT uDevice, + UINT uMsg, + DWORD dwUser, + DWORD dwParam1, + DWORD dwParam2) +{ + return MMSYSERR_NOTSUPPORTED; +} + +DWORD APIENTRY +auxMessage(UINT uDevice, + UINT uMsg, + DWORD dwUser, + DWORD dwParam1, + DWORD dwParam2) +{ + return MMSYSERR_NOTSUPPORTED; +} + +DWORD APIENTRY +wodMessage(UINT uDevice, + UINT uMsg, + DWORD dwUser, + DWORD dwParam1, + DWORD dwParam2) +{ + return MMSYSERR_NOTSUPPORTED; +} + +DWORD APIENTRY +widMessage(UINT uDevice, + UINT uMsg, + DWORD dwUser, + DWORD dwParam1, + DWORD dwParam2) +{ + return MMSYSERR_NOTSUPPORTED; +} + +DWORD APIENTRY +modMessage(UINT uDevice, + UINT uMsg, + DWORD dwUser, + DWORD dwParam1, + DWORD dwParam2) +{ + return MMSYSERR_NOTSUPPORTED; +} + +LRESULT +DriverProc(DWORD dwDriverID, + HDRVR hDriver, + UINT uiMessage, + LPARAM lParam1, + LPARAM lParam2) +{ + return DefDriverProc(dwDriverID, hDriver, uiMessage, lParam1, lParam2); +} + +BOOL WINAPI +DllMain(IN HINSTANCE hinstDLL, + IN DWORD dwReason, + IN LPVOID lpvReserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + break; + } + + return TRUE; +} + Propchange: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.def (added) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.def [iso-8859-1] Sun May 25 04:34:14 2008 @@ -1,0 +1,9 @@ +LIBRARY wdmaud.drv + +EXPORTS +DriverProc +mxdMessage +auxMessage +wodMessage +widMessage +modMessage Propchange: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.def ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild (added) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild [iso-8859-1] Sun May 25 04:34:14 2008 @@ -1,0 +1,12 @@ +<module name="wdmaud.drv" type="win32dll" baseaddress="${BASEADDRESS_RASDLG}" installbase="system32" installname="wdmaud.drv"> + <importlibrary definition="wdmaud.def" /> + <include base="wdmaud.drv">.</include> + <define name="_DISABLE_TIDENTS" /> + <library>advapi32</library> + <library>kernel32</library> + <library>winmm</library> + <library>user32</library> + <library>winmm</library> + <file>wdmaud.c</file> + <file>wdmaud.rc</file> +</module> Propchange: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rc (added) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rc [iso-8859-1] Sun May 25 04:34:14 2008 @@ -1,0 +1,7 @@ +#include <windows.h> + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS WDM Audio driver mapper\0" +#define REACTOS_STR_INTERNAL_NAME "wdmaud\0" +#define REACTOS_STR_ORIGINAL_FILENAME "wdmaud.drv\0" +#include <reactos/version.rc> Propchange: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/win32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
============================================================================== --- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Sun May 25 04:34:14 2008 @@ -346,6 +346,9 @@ <directory name="version"> <xi:include href="version/version.rbuild" /> </directory> +<directory name="wdmaud.drv"> + <xi:include href="wdmaud.drv/wdmaud.rbuild" /> +</directory> <directory name="winfax"> <xi:include href="winfax/winfax.rbuild" /> </directory>
16 years, 5 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
59
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
Results per page:
10
25
50
100
200