ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
December 2013
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
13 participants
308 discussions
Start a n
N
ew thread
[hbelusca] 61289: VDD really means "Virtual Device Drivers".
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Dec 17 23:13:11 2013 New Revision: 61289 URL:
http://svn.reactos.org/svn/reactos?rev=61289&view=rev
Log: VDD really means "Virtual Device Drivers". Modified: branches/ntvdm/subsystems/ntvdm/vddsup.c branches/ntvdm/subsystems/ntvdm/vddsup.h Modified: branches/ntvdm/subsystems/ntvdm/vddsup.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vddsup.c…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vddsup.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vddsup.c [iso-8859-1] Tue Dec 17 23:13:11 2013 @@ -2,7 +2,7 @@ * COPYRIGHT: GPL - See COPYING in the top level directory * PROJECT: ReactOS Virtual DOS Machine * FILE: vddsup.c - * PURPOSE: Virtual DOS Drivers (VDD) Support + * PURPOSE: Virtual Device Drivers (VDD) Support * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) */ Modified: branches/ntvdm/subsystems/ntvdm/vddsup.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vddsup.h…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vddsup.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vddsup.h [iso-8859-1] Tue Dec 17 23:13:11 2013 @@ -2,7 +2,7 @@ * COPYRIGHT: GPL - See COPYING in the top level directory * PROJECT: ReactOS Virtual DOS Machine * FILE: vddsup.h - * PURPOSE: Virtual DOS Drivers (VDD) Support + * PURPOSE: Virtual Device Drivers (VDD) Support * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) */
11 years
1
0
0
0
[hbelusca] 61288: [NTVDM] - Halfplement and export VdmMapFlat - Make mention of the existence of VdmFlushCache and VdmUnmapFlat, which are not exported in x86 builds (macros are therefore defined t...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Dec 17 23:03:23 2013 New Revision: 61288 URL:
http://svn.reactos.org/svn/reactos?rev=61288&view=rev
Log: [NTVDM] - Halfplement and export VdmMapFlat - Make mention of the existence of VdmFlushCache and VdmUnmapFlat, which are not exported in x86 builds (macros are therefore defined to just return TRUE) but are exported in MIPS... builds... See VDDSVC.H and NT_VDD.H in the DDK (those headers don't exist in ROS; we'll have to create them later on). Modified: branches/ntvdm/subsystems/ntvdm/emulator.c branches/ntvdm/subsystems/ntvdm/ntvdm.spec Modified: branches/ntvdm/subsystems/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Tue Dec 17 23:03:23 2013 @@ -18,6 +18,9 @@ #include "registers.h" #include "vga.h" #include "pic.h" + +// HACK +typedef INT VDM_MODE; /* PRIVATE VARIABLES **********************************************************/ @@ -173,7 +176,10 @@ -PBYTE WINAPI Sim32pGetVDMPointer(ULONG Address, BOOL ProtectedMode) +PBYTE +WINAPI +Sim32pGetVDMPointer(IN ULONG Address, + IN BOOL ProtectedMode) { // FIXME UNREFERENCED_PARAMETER(ProtectedMode); @@ -186,10 +192,50 @@ return SEG_OFF_TO_PTR(HIWORD(Address), LOWORD(Address)); } -PBYTE WINAPI MGetVdmPointer(ULONG Address, ULONG Size, BOOL ProtectedMode) +PBYTE +WINAPI +MGetVdmPointer(IN ULONG Address, + IN ULONG Size, + IN BOOL ProtectedMode) { UNREFERENCED_PARAMETER(Size); return Sim32pGetVDMPointer(Address, ProtectedMode); } +PVOID +WINAPI +VdmMapFlat(IN USHORT Segment, + IN ULONG Offset, + IN VDM_MODE Mode) +{ + // FIXME + UNREFERENCED_PARAMETER(Mode); + + return SEG_OFF_TO_PTR(Segment, Offset); +} + +BOOL +WINAPI +VdmFlushCache(IN USHORT Segment, + IN ULONG Offset, + IN ULONG Size, + IN VDM_MODE Mode) +{ + // FIXME + UNIMPLEMENTED; + return TRUE; +} + +BOOL +WINAPI +VdmUnmapFlat(IN USHORT Segment, + IN ULONG Offset, + IN PVOID Buffer, + IN VDM_MODE Mode) +{ + // FIXME + UNIMPLEMENTED; + return TRUE; +} + /* EOF */ Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.spec URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.sp…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.spec [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.spec [iso-8859-1] Tue Dec 17 23:03:23 2013 @@ -91,3 +91,7 @@ @ stdcall MGetVdmPointer(long long long) @ stdcall Sim32pGetVDMPointer(long long) + +;@ stdcall VdmFlushCache(long long long long) ; Not exported on x86 +@ stdcall VdmMapFlat(long long long) +;@ stdcall VdmUnmapFlat(long long ptr long) ; Not exported on x86
11 years
1
0
0
0
[hbelusca] 61287: [NTVDM] Studying the "vddtest" example mentioned in revision 61283 allowed me to see that valid VDD DLL "handles" start at 1 and cannot be equal to zero. Add helper macros to conv...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Dec 17 22:34:08 2013 New Revision: 61287 URL:
http://svn.reactos.org/svn/reactos?rev=61287&view=rev
Log: [NTVDM] Studying the "vddtest" example mentioned in revision 61283 allowed me to see that valid VDD DLL "handles" start at 1 and cannot be equal to zero. Add helper macros to convert from indices to handles. Fixes "vddtest" example. Have fun at running it :) Modified: branches/ntvdm/subsystems/ntvdm/vddsup.c Modified: branches/ntvdm/subsystems/ntvdm/vddsup.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vddsup.c…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vddsup.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vddsup.c [iso-8859-1] Tue Dec 17 22:34:08 2013 @@ -29,9 +29,15 @@ /* PRIVATE VARIABLES **********************************************************/ +// TODO: Maybe use a linked list. +// But the number of elements must be <= MAXUSHORT #define MAX_VDD_MODULES 0xFF + 1 -VDD_MODULE VDDList[MAX_VDD_MODULES] = {{NULL}}; // TODO: Maybe use a linked list. - // But the number of elements must be <= MAXUSHORT +VDD_MODULE VDDList[MAX_VDD_MODULES] = {{NULL}}; + +// Valid handles of VDD DLLs start at 1 and finish at MAX_VDD_MODULES +#define ENTRY_TO_HANDLE(Entry) ((Entry) + 1) +#define HANDLE_TO_ENTRY(Handle) ((Handle) - 1) +#define IS_VALID_HANDLE(Handle) ((Handle) > 0 && (Handle) <= MAX_VDD_MODULES) /* PRIVATE FUNCTIONS **********************************************************/ @@ -72,14 +78,14 @@ setCF(0); /* Retrieve the VDD name in DS:SI */ - DllName = SEG_OFF_TO_PTR(getDS(), getSI()); + DllName = (LPCSTR)SEG_OFF_TO_PTR(getDS(), getSI()); /* Retrieve the initialization routine API name in ES:DI (optional --> ES=DI=0) */ if (getES() != 0 || getDI() != 0) - InitRoutineName = SEG_OFF_TO_PTR(getES(), getDI()); + InitRoutineName = (LPCSTR)SEG_OFF_TO_PTR(getES(), getDI()); /* Retrieve the dispatch routine API name in DS:BX */ - DispatchRoutineName = SEG_OFF_TO_PTR(getDS(), getBX()); + DispatchRoutineName = (LPCSTR)SEG_OFF_TO_PTR(getDS(), getBX()); DPRINT1("DllName = '%s' - InitRoutineName = '%s' - DispatchRoutineName = '%s'\n", (DllName ? DllName : "n/a"), @@ -147,9 +153,9 @@ /* Call the initialization routine if needed */ if (InitRoutine) InitRoutine(); - /* We succeeded */ + /* We succeeded. RetVal will contain a valid VDD DLL handle */ Success = TRUE; - RetVal = Entry; + RetVal = ENTRY_TO_HANDLE(Entry); // Convert the entry to a valid handle Quit: if (!Success) @@ -172,12 +178,13 @@ /* UnRegisterModule */ case 1: { - WORD Entry = getAX(); + WORD Handle = getAX(); + WORD Entry = HANDLE_TO_ENTRY(Handle); // Convert the handle to a valid entry DPRINT1("UnRegisterModule() called\n"); /* Sanity checks */ - if (Entry > MAX_VDD_MODULES || VDDList[Entry].hDll == NULL) + if (!IS_VALID_HANDLE(Handle) || VDDList[Entry].hDll == NULL) { DPRINT1("Invalid VDD DLL Handle: %d\n", Entry); /* Stop the VDM */ @@ -195,12 +202,13 @@ /* DispatchCall */ case 2: { - WORD Entry = getAX(); + WORD Handle = getAX(); + WORD Entry = HANDLE_TO_ENTRY(Handle); // Convert the handle to a valid entry DPRINT1("DispatchCall() called\n"); /* Sanity checks */ - if (Entry > MAX_VDD_MODULES || + if (!IS_VALID_HANDLE(Handle) || VDDList[Entry].hDll == NULL || VDDList[Entry].DispatchRoutine == NULL) {
11 years
1
0
0
0
[hbelusca] 61286: [NTVDM] - Thanks Thomas for having pointed me towards the fact that the NTVDM exports were really STDCALL and not CDECL (as I've thought first, because originally I was checking w...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Dec 17 22:10:58 2013 New Revision: 61286 URL:
http://svn.reactos.org/svn/reactos?rev=61286&view=rev
Log: [NTVDM] - Thanks Thomas for having pointed me towards the fact that the NTVDM exports were really STDCALL and not CDECL (as I've thought first, because originally I was checking whether the getXX() functions were stdcall or not, and distinguishing VOID stdcall or cdecl functions without the symbols was hopeless). - Halfplement and export Sim32pGetVDMPointer and MGetVdmPointer, needed to run correctly the RageStorm "galaxy" sample mentioned yesterday (see revision 61283). Now it loads and the dispatch call works \o/ - VDD_INIT_PROC and VDD_DISPATCH_PROC have the same signature --> rename them to VDD_PROC. Have fun at testing! Modified: branches/ntvdm/subsystems/ntvdm/emulator.c branches/ntvdm/subsystems/ntvdm/ntvdm.spec branches/ntvdm/subsystems/ntvdm/registers.c branches/ntvdm/subsystems/ntvdm/registers.h branches/ntvdm/subsystems/ntvdm/vddsup.c Modified: branches/ntvdm/subsystems/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Tue Dec 17 22:10:58 2013 @@ -171,4 +171,25 @@ A20Line = Enabled; } + + +PBYTE WINAPI Sim32pGetVDMPointer(ULONG Address, BOOL ProtectedMode) +{ + // FIXME + UNREFERENCED_PARAMETER(ProtectedMode); + + /* + * HIWORD(Address) == Segment (if ProtectedMode == FALSE) + * or Selector (if ProtectedMode == TRUE ) + * LOWORD(Address) == Offset + */ + return SEG_OFF_TO_PTR(HIWORD(Address), LOWORD(Address)); +} + +PBYTE WINAPI MGetVdmPointer(ULONG Address, ULONG Size, BOOL ProtectedMode) +{ + UNREFERENCED_PARAMETER(Size); + return Sim32pGetVDMPointer(Address, ProtectedMode); +} + /* EOF */ Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.spec URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.sp…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.spec [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.spec [iso-8859-1] Tue Dec 17 22:10:58 2013 @@ -1,88 +1,93 @@ -@ cdecl getAF() -@ cdecl getAH() -@ cdecl getAL() -@ cdecl getAX() -@ cdecl getBH() -@ cdecl getBL() -@ cdecl getBP() -@ cdecl getBX() -@ cdecl getCF() -@ cdecl getCH() -@ cdecl getCL() -@ cdecl getCS() -@ cdecl getCX() -@ cdecl getDF() -@ cdecl getDH() -@ cdecl getDI() -@ cdecl getDL() -@ cdecl getDS() -@ cdecl getDX() -@ cdecl getEAX() -@ cdecl getEBP() -@ cdecl getEBX() -@ cdecl getECX() -@ cdecl getEDI() -@ cdecl getEDX() -@ cdecl getEFLAGS() -@ cdecl getEIP() -@ cdecl getES() -@ cdecl getESI() -@ cdecl getESP() -@ cdecl getFS() -@ cdecl getGS() -@ cdecl getIF() -; @ cdecl getIntelRegistersPointer() -@ cdecl getIP() -@ cdecl getMSW() -@ cdecl getOF() -@ cdecl getPF() -@ cdecl getSF() -@ cdecl getSI() -@ cdecl getSP() -@ cdecl getSS() -@ cdecl getZF() +@ stdcall getAF() +@ stdcall getAH() +@ stdcall getAL() +@ stdcall getAX() +@ stdcall getBH() +@ stdcall getBL() +@ stdcall getBP() +@ stdcall getBX() +@ stdcall getCF() +@ stdcall getCH() +@ stdcall getCL() +@ stdcall getCS() +@ stdcall getCX() +@ stdcall getDF() +@ stdcall getDH() +@ stdcall getDI() +@ stdcall getDL() +@ stdcall getDS() +@ stdcall getDX() +@ stdcall getEAX() +@ stdcall getEBP() +@ stdcall getEBX() +@ stdcall getECX() +@ stdcall getEDI() +@ stdcall getEDX() +@ stdcall getEFLAGS() +@ stdcall getEIP() +@ stdcall getES() +@ stdcall getESI() +@ stdcall getESP() +@ stdcall getFS() +@ stdcall getGS() +@ stdcall getIF() +; @ stdcall getIntelRegistersPointer() +@ stdcall getIP() +@ stdcall getMSW() +@ stdcall getOF() +@ stdcall getPF() +@ stdcall getSF() +@ stdcall getSI() +@ stdcall getSP() +@ stdcall getSS() +@ stdcall getZF() -@ cdecl setAF(long) -@ cdecl setAH(long) -@ cdecl setAL(long) -@ cdecl setAX(long) -@ cdecl setBH(long) -@ cdecl setBL(long) -@ cdecl setBP(long) -@ cdecl setBX(long) -@ cdecl setCF(long) -@ cdecl setCH(long) -@ cdecl setCL(long) -@ cdecl setCS(long) -@ cdecl setCX(long) -@ cdecl setDF(long) -@ cdecl setDH(long) -@ cdecl setDI(long) -@ cdecl setDL(long) -@ cdecl setDS(long) -@ cdecl setDX(long) -@ cdecl setEAX(long) -@ cdecl setEBP(long) -@ cdecl setEBX(long) -@ cdecl setECX(long) -@ cdecl setEDI(long) -@ cdecl setEDX(long) -@ cdecl setEFLAGS(long) -@ cdecl setEIP(long) -@ cdecl setES(long) -@ cdecl setESI(long) -@ cdecl setESP(long) -@ cdecl setFS(long) -@ cdecl setGS(long) -@ cdecl setIF(long) -@ cdecl setIP(long) -@ cdecl setMSW(long) -@ cdecl setOF(long) -@ cdecl setPF(long) -@ cdecl setSF(long) -@ cdecl setSI(long) -@ cdecl setSP(long) -@ cdecl setSS(long) -@ cdecl setZF(long) +@ stdcall setAF(long) +@ stdcall setAH(long) +@ stdcall setAL(long) +@ stdcall setAX(long) +@ stdcall setBH(long) +@ stdcall setBL(long) +@ stdcall setBP(long) +@ stdcall setBX(long) +@ stdcall setCF(long) +@ stdcall setCH(long) +@ stdcall setCL(long) +@ stdcall setCS(long) +@ stdcall setCX(long) +@ stdcall setDF(long) +@ stdcall setDH(long) +@ stdcall setDI(long) +@ stdcall setDL(long) +@ stdcall setDS(long) +@ stdcall setDX(long) +@ stdcall setEAX(long) +@ stdcall setEBP(long) +@ stdcall setEBX(long) +@ stdcall setECX(long) +@ stdcall setEDI(long) +@ stdcall setEDX(long) +@ stdcall setEFLAGS(long) +@ stdcall setEIP(long) +@ stdcall setES(long) +@ stdcall setESI(long) +@ stdcall setESP(long) +@ stdcall setFS(long) +@ stdcall setGS(long) +@ stdcall setIF(long) +@ stdcall setIP(long) +@ stdcall setMSW(long) +@ stdcall setOF(long) +@ stdcall setPF(long) +@ stdcall setSF(long) +@ stdcall setSI(long) +@ stdcall setSP(long) +@ stdcall setSS(long) +@ stdcall setZF(long) + + + +@ stdcall MGetVdmPointer(long long long) +@ stdcall Sim32pGetVDMPointer(long long) Modified: branches/ntvdm/subsystems/ntvdm/registers.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/register…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/registers.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/registers.c [iso-8859-1] Tue Dec 17 22:10:58 2013 @@ -38,112 +38,112 @@ ULONG -CDECL +WINAPI getEAX(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long; } VOID -CDECL +WINAPI setEAX(ULONG Value) { EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long = Value; } USHORT -CDECL +WINAPI getAX(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowWord; } VOID -CDECL +WINAPI setAX(USHORT Value) { EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowWord = Value; } UCHAR -CDECL +WINAPI getAH(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EAX].HighByte; } VOID -CDECL +WINAPI setAH(UCHAR Value) { EmulatorContext.GeneralRegs[FAST486_REG_EAX].HighByte = Value; } UCHAR -CDECL +WINAPI getAL(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowByte; } VOID -CDECL +WINAPI setAL(UCHAR Value) { EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowByte = Value; } ULONG -CDECL +WINAPI getEBX(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long; } VOID -CDECL +WINAPI setEBX(ULONG Value) { EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long = Value; } USHORT -CDECL +WINAPI getBX(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowWord; } VOID -CDECL +WINAPI setBX(USHORT Value) { EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowWord = Value; } UCHAR -CDECL +WINAPI getBH(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EBX].HighByte; } VOID -CDECL +WINAPI setBH(UCHAR Value) { EmulatorContext.GeneralRegs[FAST486_REG_EBX].HighByte = Value; } UCHAR -CDECL +WINAPI getBL(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowByte; } VOID -CDECL +WINAPI setBL(UCHAR Value) { EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowByte = Value; @@ -152,56 +152,56 @@ ULONG -CDECL +WINAPI getECX(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long; } VOID -CDECL +WINAPI setECX(ULONG Value) { EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long = Value; } USHORT -CDECL +WINAPI getCX(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowWord; } VOID -CDECL +WINAPI setCX(USHORT Value) { EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowWord = Value; } UCHAR -CDECL +WINAPI getCH(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_ECX].HighByte; } VOID -CDECL +WINAPI setCH(UCHAR Value) { EmulatorContext.GeneralRegs[FAST486_REG_ECX].HighByte = Value; } UCHAR -CDECL +WINAPI getCL(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowByte; } VOID -CDECL +WINAPI setCL(UCHAR Value) { EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowByte = Value; @@ -210,56 +210,56 @@ ULONG -CDECL +WINAPI getEDX(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long; } VOID -CDECL +WINAPI setEDX(ULONG Value) { EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long = Value; } USHORT -CDECL +WINAPI getDX(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowWord; } VOID -CDECL +WINAPI setDX(USHORT Value) { EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowWord = Value; } UCHAR -CDECL +WINAPI getDH(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EDX].HighByte; } VOID -CDECL +WINAPI setDH(UCHAR Value) { EmulatorContext.GeneralRegs[FAST486_REG_EDX].HighByte = Value; } UCHAR -CDECL +WINAPI getDL(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowByte; } VOID -CDECL +WINAPI setDL(UCHAR Value) { EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowByte = Value; @@ -268,28 +268,28 @@ ULONG -CDECL +WINAPI getESP(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_ESP].Long; } VOID -CDECL +WINAPI setESP(ULONG Value) { EmulatorSetStack(getSS(), Value); } USHORT -CDECL +WINAPI getSP(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_ESP].LowWord; } VOID -CDECL +WINAPI setSP(USHORT Value) { EmulatorSetStack(getSS(), Value); @@ -298,28 +298,28 @@ ULONG -CDECL +WINAPI getEBP(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EBP].Long; } VOID -CDECL +WINAPI setEBP(ULONG Value) { EmulatorContext.GeneralRegs[FAST486_REG_EBP].Long = Value; } USHORT -CDECL +WINAPI getBP(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EBP].LowWord; } VOID -CDECL +WINAPI setBP(USHORT Value) { EmulatorContext.GeneralRegs[FAST486_REG_EBP].LowWord = Value; @@ -328,28 +328,28 @@ ULONG -CDECL +WINAPI getESI(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long; } VOID -CDECL +WINAPI setESI(ULONG Value) { EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long = Value; } USHORT -CDECL +WINAPI getSI(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_ESI].LowWord; } VOID -CDECL +WINAPI setSI(USHORT Value) { EmulatorContext.GeneralRegs[FAST486_REG_ESI].LowWord = Value; @@ -358,28 +358,28 @@ ULONG -CDECL +WINAPI getEDI(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long; } VOID -CDECL +WINAPI setEDI(ULONG Value) { EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long = Value; } USHORT -CDECL +WINAPI getDI(VOID) { return EmulatorContext.GeneralRegs[FAST486_REG_EDI].LowWord; } VOID -CDECL +WINAPI setDI(USHORT Value) { EmulatorContext.GeneralRegs[FAST486_REG_EDI].LowWord = Value; @@ -388,28 +388,28 @@ ULONG -CDECL +WINAPI getEIP(VOID) { return EmulatorContext.InstPtr.Long; } VOID -CDECL +WINAPI setEIP(ULONG Value) { EmulatorExecute(getCS(), Value); } USHORT -CDECL +WINAPI getIP(VOID) { return EmulatorContext.InstPtr.LowWord; } VOID -CDECL +WINAPI setIP(USHORT Value) { EmulatorExecute(getCS(), Value); @@ -418,84 +418,84 @@ USHORT -CDECL +WINAPI getCS(VOID) { return EmulatorContext.SegmentRegs[FAST486_REG_CS].Selector; } VOID -CDECL +WINAPI setCS(USHORT Value) { Fast486SetSegment(&EmulatorContext, FAST486_REG_CS, Value); } USHORT -CDECL +WINAPI getSS(VOID) { return EmulatorContext.SegmentRegs[FAST486_REG_SS].Selector; } VOID -CDECL +WINAPI setSS(USHORT Value) { Fast486SetSegment(&EmulatorContext, FAST486_REG_SS, Value); } USHORT -CDECL +WINAPI getDS(VOID) { return EmulatorContext.SegmentRegs[FAST486_REG_DS].Selector; } VOID -CDECL +WINAPI setDS(USHORT Value) { Fast486SetSegment(&EmulatorContext, FAST486_REG_DS, Value); } USHORT -CDECL +WINAPI getES(VOID) { return EmulatorContext.SegmentRegs[FAST486_REG_ES].Selector; } VOID -CDECL +WINAPI setES(USHORT Value) { Fast486SetSegment(&EmulatorContext, FAST486_REG_ES, Value); } USHORT -CDECL +WINAPI getFS(VOID) { return EmulatorContext.SegmentRegs[FAST486_REG_FS].Selector; } VOID -CDECL +WINAPI setFS(USHORT Value) { Fast486SetSegment(&EmulatorContext, FAST486_REG_FS, Value); } USHORT -CDECL +WINAPI getGS(VOID) { return EmulatorContext.SegmentRegs[FAST486_REG_GS].Selector; } VOID -CDECL +WINAPI setGS(USHORT Value) { Fast486SetSegment(&EmulatorContext, FAST486_REG_GS, Value); @@ -504,14 +504,14 @@ ULONG -CDECL +WINAPI getCF(VOID) { return EmulatorGetFlag(EMULATOR_FLAG_CF); } VOID -CDECL +WINAPI setCF(ULONG Flag) { if (Flag & 1) @@ -521,14 +521,14 @@ } ULONG -CDECL +WINAPI getPF(VOID) { return EmulatorGetFlag(EMULATOR_FLAG_PF); } VOID -CDECL +WINAPI setPF(ULONG Flag) { if (Flag & 1) @@ -538,14 +538,14 @@ } ULONG -CDECL +WINAPI getAF(VOID) { return EmulatorGetFlag(EMULATOR_FLAG_AF); } VOID -CDECL +WINAPI setAF(ULONG Flag) { if (Flag & 1) @@ -555,14 +555,14 @@ } ULONG -CDECL +WINAPI getZF(VOID) { return EmulatorGetFlag(EMULATOR_FLAG_ZF); } VOID -CDECL +WINAPI setZF(ULONG Flag) { if (Flag & 1) @@ -572,14 +572,14 @@ } ULONG -CDECL +WINAPI getSF(VOID) { return EmulatorGetFlag(EMULATOR_FLAG_SF); } VOID -CDECL +WINAPI setSF(ULONG Flag) { if (Flag & 1) @@ -589,14 +589,14 @@ } ULONG -CDECL +WINAPI getIF(VOID) { return EmulatorGetFlag(EMULATOR_FLAG_IF); } VOID -CDECL +WINAPI setIF(ULONG Flag) { if (Flag & 1) @@ -606,14 +606,14 @@ } ULONG -CDECL +WINAPI getDF(VOID) { return EmulatorGetFlag(EMULATOR_FLAG_DF); } VOID -CDECL +WINAPI setDF(ULONG Flag) { if (Flag & 1) @@ -623,14 +623,14 @@ } ULONG -CDECL +WINAPI getOF(VOID) { return EmulatorGetFlag(EMULATOR_FLAG_OF); } VOID -CDECL +WINAPI setOF(ULONG Flag) { if (Flag & 1) @@ -642,14 +642,14 @@ ULONG -CDECL +WINAPI getEFLAGS(VOID) { return EmulatorContext.Flags.Long; } VOID -CDECL +WINAPI setEFLAGS(ULONG Flags) { EmulatorContext.Flags.Long = Flags; @@ -658,14 +658,14 @@ USHORT -CDECL +WINAPI getMSW(VOID) { return LOWORD(EmulatorContext.ControlRegisters[FAST486_REG_CR0]); } VOID -CDECL +WINAPI setMSW(USHORT Value) { /* Set the lower 16 bits (Machine Status Word) of CR0 */ Modified: branches/ntvdm/subsystems/ntvdm/registers.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/register…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/registers.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/registers.h [iso-8859-1] Tue Dec 17 22:10:58 2013 @@ -14,104 +14,104 @@ VOID EmulatorSetStack(WORD Segment, DWORD Offset); -ULONG getEAX(VOID); -VOID setEAX(ULONG); -USHORT getAX(VOID); -VOID setAX(USHORT); -UCHAR getAH(VOID); -VOID setAH(UCHAR); -UCHAR getAL(VOID); -VOID setAL(UCHAR); +ULONG WINAPI getEAX(VOID); +VOID WINAPI setEAX(ULONG); +USHORT WINAPI getAX(VOID); +VOID WINAPI setAX(USHORT); +UCHAR WINAPI getAH(VOID); +VOID WINAPI setAH(UCHAR); +UCHAR WINAPI getAL(VOID); +VOID WINAPI setAL(UCHAR); -ULONG getEBX(VOID); -VOID setEBX(ULONG); -USHORT getBX(VOID); -VOID setBX(USHORT); -UCHAR getBH(VOID); -VOID setBH(UCHAR); -UCHAR getBL(VOID); -VOID setBL(UCHAR); +ULONG WINAPI getEBX(VOID); +VOID WINAPI setEBX(ULONG); +USHORT WINAPI getBX(VOID); +VOID WINAPI setBX(USHORT); +UCHAR WINAPI getBH(VOID); +VOID WINAPI setBH(UCHAR); +UCHAR WINAPI getBL(VOID); +VOID WINAPI setBL(UCHAR); -ULONG getECX(VOID); -VOID setECX(ULONG); -USHORT getCX(VOID); -VOID setCX(USHORT); -UCHAR getCH(VOID); -VOID setCH(UCHAR); -UCHAR getCL(VOID); -VOID setCL(UCHAR); +ULONG WINAPI getECX(VOID); +VOID WINAPI setECX(ULONG); +USHORT WINAPI getCX(VOID); +VOID WINAPI setCX(USHORT); +UCHAR WINAPI getCH(VOID); +VOID WINAPI setCH(UCHAR); +UCHAR WINAPI getCL(VOID); +VOID WINAPI setCL(UCHAR); -ULONG getEDX(VOID); -VOID setEDX(ULONG); -USHORT getDX(VOID); -VOID setDX(USHORT); -UCHAR getDH(VOID); -VOID setDH(UCHAR); -UCHAR getDL(VOID); -VOID setDL(UCHAR); +ULONG WINAPI getEDX(VOID); +VOID WINAPI setEDX(ULONG); +USHORT WINAPI getDX(VOID); +VOID WINAPI setDX(USHORT); +UCHAR WINAPI getDH(VOID); +VOID WINAPI setDH(UCHAR); +UCHAR WINAPI getDL(VOID); +VOID WINAPI setDL(UCHAR); -ULONG getESP(VOID); -VOID setESP(ULONG); -USHORT getSP(VOID); -VOID setSP(USHORT); +ULONG WINAPI getESP(VOID); +VOID WINAPI setESP(ULONG); +USHORT WINAPI getSP(VOID); +VOID WINAPI setSP(USHORT); -ULONG getEBP(VOID); -VOID setEBP(ULONG); -USHORT getBP(VOID); -VOID setBP(USHORT); +ULONG WINAPI getEBP(VOID); +VOID WINAPI setEBP(ULONG); +USHORT WINAPI getBP(VOID); +VOID WINAPI setBP(USHORT); -ULONG getESI(VOID); -VOID setESI(ULONG); -USHORT getSI(VOID); -VOID setSI(USHORT); +ULONG WINAPI getESI(VOID); +VOID WINAPI setESI(ULONG); +USHORT WINAPI getSI(VOID); +VOID WINAPI setSI(USHORT); -ULONG getEDI(VOID); -VOID setEDI(ULONG); -USHORT getDI(VOID); -VOID setDI(USHORT); +ULONG WINAPI getEDI(VOID); +VOID WINAPI setEDI(ULONG); +USHORT WINAPI getDI(VOID); +VOID WINAPI setDI(USHORT); -ULONG getEIP(VOID); -VOID setEIP(ULONG); -USHORT getIP(VOID); -VOID setIP(USHORT); +ULONG WINAPI getEIP(VOID); +VOID WINAPI setEIP(ULONG); +USHORT WINAPI getIP(VOID); +VOID WINAPI setIP(USHORT); -USHORT getCS(VOID); -VOID setCS(USHORT); -USHORT getSS(VOID); -VOID setSS(USHORT); -USHORT getDS(VOID); -VOID setDS(USHORT); -USHORT getES(VOID); -VOID setES(USHORT); -USHORT getFS(VOID); -VOID setFS(USHORT); -USHORT getGS(VOID); -VOID setGS(USHORT); +USHORT WINAPI getCS(VOID); +VOID WINAPI setCS(USHORT); +USHORT WINAPI getSS(VOID); +VOID WINAPI setSS(USHORT); +USHORT WINAPI getDS(VOID); +VOID WINAPI setDS(USHORT); +USHORT WINAPI getES(VOID); +VOID WINAPI setES(USHORT); +USHORT WINAPI getFS(VOID); +VOID WINAPI setFS(USHORT); +USHORT WINAPI getGS(VOID); +VOID WINAPI setGS(USHORT); -ULONG getCF(VOID); -VOID setCF(ULONG); -ULONG getPF(VOID); -VOID setPF(ULONG); -ULONG getAF(VOID); -VOID setAF(ULONG); -ULONG getZF(VOID); -VOID setZF(ULONG); -ULONG getSF(VOID); -VOID setSF(ULONG); -ULONG getIF(VOID); -VOID setIF(ULONG); -ULONG getDF(VOID); -VOID setDF(ULONG); -ULONG getOF(VOID); -VOID setOF(ULONG); +ULONG WINAPI getCF(VOID); +VOID WINAPI setCF(ULONG); +ULONG WINAPI getPF(VOID); +VOID WINAPI setPF(ULONG); +ULONG WINAPI getAF(VOID); +VOID WINAPI setAF(ULONG); +ULONG WINAPI getZF(VOID); +VOID WINAPI setZF(ULONG); +ULONG WINAPI getSF(VOID); +VOID WINAPI setSF(ULONG); +ULONG WINAPI getIF(VOID); +VOID WINAPI setIF(ULONG); +ULONG WINAPI getDF(VOID); +VOID WINAPI setDF(ULONG); +ULONG WINAPI getOF(VOID); +VOID WINAPI setOF(ULONG); -ULONG getEFLAGS(VOID); -VOID setEFLAGS(ULONG); +ULONG WINAPI getEFLAGS(VOID); +VOID WINAPI setEFLAGS(ULONG); -USHORT getMSW(VOID); -VOID setMSW(USHORT); +USHORT WINAPI getMSW(VOID); +VOID WINAPI setMSW(USHORT); #endif // _REGISTERS_H_ Modified: branches/ntvdm/subsystems/ntvdm/vddsup.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vddsup.c…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vddsup.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vddsup.c [iso-8859-1] Tue Dec 17 22:10:58 2013 @@ -16,13 +16,12 @@ #include "bop.h" #include "registers.h" -typedef VOID (CDECL *VDD_INIT_PROC)(VOID); -typedef VOID (CDECL *VDD_DISPATCH_PROC)(VOID); +typedef VOID (WINAPI *VDD_PROC)(VOID); typedef struct _VDD_MODULE { - HMODULE hDll; - VDD_DISPATCH_PROC DispatchRoutine; + HMODULE hDll; + VDD_PROC DispatchRoutine; } VDD_MODULE, *PVDD_MODULE; /* BOP Identifiers */ @@ -30,7 +29,7 @@ /* PRIVATE VARIABLES **********************************************************/ -#define MAX_VDD_MODULES 0xFF +#define MAX_VDD_MODULES 0xFF + 1 VDD_MODULE VDDList[MAX_VDD_MODULES] = {{NULL}}; // TODO: Maybe use a linked list. // But the number of elements must be <= MAXUSHORT @@ -58,14 +57,14 @@ case 0: { BOOL Success = TRUE; - WORD RetVal = 0; - WORD Entry = 0; + WORD RetVal = 0; + WORD Entry = 0; LPCSTR DllName = NULL, - InitRoutineName = NULL, + InitRoutineName = NULL, DispatchRoutineName = NULL; HMODULE hDll = NULL; - VDD_INIT_PROC InitRoutine = NULL; - VDD_DISPATCH_PROC DispatchRoutine = NULL; + VDD_PROC InitRoutine = NULL, + DispatchRoutine = NULL; DPRINT1("RegisterModule() called\n"); @@ -111,7 +110,7 @@ /* Load the initialization routine if needed */ if (InitRoutineName) { - InitRoutine = (VDD_INIT_PROC)GetProcAddress(hDll, InitRoutineName); + InitRoutine = (VDD_PROC)GetProcAddress(hDll, InitRoutineName); if (InitRoutine == NULL) { DPRINT1("Failed to load the initialization routine '%s'\n", InitRoutineName); @@ -122,7 +121,7 @@ } /* Load the dispatch routine */ - DispatchRoutine = (VDD_DISPATCH_PROC)GetProcAddress(hDll, DispatchRoutineName); + DispatchRoutine = (VDD_PROC)GetProcAddress(hDll, DispatchRoutineName); if (DispatchRoutine == NULL) { DPRINT1("Failed to load the dispatch routine '%s'\n", DispatchRoutineName);
11 years
1
0
0
0
[ekohl] 61285: [ADVAPI32] Do not deregister the logon process after logon. Close the port when the DLL is unloaded.
by ekohl@svn.reactos.org
Author: ekohl Date: Tue Dec 17 21:01:18 2013 New Revision: 61285 URL:
http://svn.reactos.org/svn/reactos?rev=61285&view=rev
Log: [ADVAPI32] Do not deregister the logon process after logon. Close the port when the DLL is unloaded. Modified: trunk/reactos/dll/win32/advapi32/advapi32.h trunk/reactos/dll/win32/advapi32/misc/dllmain.c trunk/reactos/dll/win32/advapi32/misc/logon.c Modified: trunk/reactos/dll/win32/advapi32/advapi32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
============================================================================== --- trunk/reactos/dll/win32/advapi32/advapi32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/advapi32.h [iso-8859-1] Tue Dec 17 21:01:18 2013 @@ -55,6 +55,11 @@ #ifndef HAS_FN_PROGRESSA #define FN_PROGRESSA FN_PROGRESS #endif + +/* logon.c */ + +NTSTATUS +CloseLogonLsaHandle(VOID); /* rpc.c */ Modified: trunk/reactos/dll/win32/advapi32/misc/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/dl…
============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/dllmain.c [iso-8859-1] Tue Dec 17 21:01:18 2013 @@ -15,8 +15,10 @@ extern BOOL RegCleanup(VOID); extern VOID UnloadNtMarta(VOID); -BOOL WINAPI -DllMain(HINSTANCE hinstDll, +BOOL +WINAPI +DllMain( + HINSTANCE hinstDll, DWORD dwReason, LPVOID reserved) { @@ -26,7 +28,9 @@ DisableThreadLibraryCalls(hinstDll); RegInitialize(); break; + case DLL_PROCESS_DETACH: + CloseLogonLsaHandle(); RegCleanup(); UnloadNtMarta(); break; Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/lo…
============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] Tue Dec 17 21:01:18 2013 @@ -9,7 +9,82 @@ #include <advapi32.h> WINE_DEFAULT_DEBUG_CHANNEL(advapi); +/* GLOBALS *****************************************************************/ + +HANDLE LsaHandle = NULL; +ULONG AuthenticationPackage = 0; + /* FUNCTIONS ***************************************************************/ + +static +NTSTATUS +OpenLogonLsaHandle(VOID) +{ + LSA_STRING LogonProcessName; + LSA_STRING PackageName; + LSA_OPERATIONAL_MODE SecurityMode = 0; + NTSTATUS Status; + + RtlInitAnsiString((PANSI_STRING)&LogonProcessName, + "User32LogonProcess"); + + Status = LsaRegisterLogonProcess(&LogonProcessName, + &LsaHandle, + &SecurityMode); + if (!NT_SUCCESS(Status)) + { + TRACE("LsaRegisterLogonProcess failed (Status 0x%08lx)\n", Status); + goto done; + } + + RtlInitAnsiString((PANSI_STRING)&PackageName, + MSV1_0_PACKAGE_NAME); + + Status = LsaLookupAuthenticationPackage(LsaHandle, + &PackageName, + &AuthenticationPackage); + if (!NT_SUCCESS(Status)) + { + TRACE("LsaLookupAuthenticationPackage failed (Status 0x%08lx)\n", Status); + goto done; + } + + TRACE("AuthenticationPackage: 0x%08lx\n", AuthenticationPackage); + +done: + if (!NT_SUCCESS(Status)) + { + if (LsaHandle != NULL) + { + Status = LsaDeregisterLogonProcess(LsaHandle); + if (!NT_SUCCESS(Status)) + { + TRACE("LsaDeregisterLogonProcess failed (Status 0x%08lx)\n", Status); + } + } + } + + return Status; +} + + +NTSTATUS +CloseLogonLsaHandle(VOID) +{ + NTSTATUS Status = STATUS_SUCCESS; + + if (LsaHandle != NULL) + { + Status = LsaDeregisterLogonProcess(LsaHandle); + if (!NT_SUCCESS(Status)) + { + TRACE("LsaDeregisterLogonProcess failed (Status 0x%08lx)\n", Status); + } + } + + return Status; +} + /* * @implemented @@ -224,11 +299,6 @@ { SID_IDENTIFIER_AUTHORITY LocalAuthority = {SECURITY_LOCAL_SID_AUTHORITY}; SID_IDENTIFIER_AUTHORITY SystemAuthority = {SECURITY_NT_AUTHORITY}; - LSA_STRING LogonProcessName; - LSA_STRING PackageName; - HANDLE LsaHandle = NULL; - LSA_OPERATIONAL_MODE SecurityMode = 0; - ULONG AuthenticationPackage = 0; PSID LogonSid = NULL; PSID LocalSid = NULL; LSA_STRING OriginName; @@ -251,32 +321,12 @@ *phToken = NULL; - RtlInitAnsiString((PANSI_STRING)&LogonProcessName, - "User32LogonProcess"); - - Status = LsaRegisterLogonProcess(&LogonProcessName, - &LsaHandle, - &SecurityMode); - if (!NT_SUCCESS(Status)) - { - TRACE("LsaRegisterLogonProcess failed (Status 0x%08lx)\n", Status); - goto done; - } - - RtlInitAnsiString((PANSI_STRING)&PackageName, - MSV1_0_PACKAGE_NAME); - - Status = LsaLookupAuthenticationPackage(LsaHandle, - &PackageName, - &AuthenticationPackage); - if (!NT_SUCCESS(Status)) - { - TRACE("LsaLookupAuthenticationPackage failed (Status 0x%08lx)\n", Status); - goto done; - } - - TRACE("AuthenticationPackage: 0x%08lx\n", AuthenticationPackage); - + if (LsaHandle == NULL) + { + Status = OpenLogonLsaHandle(); + if (!NT_SUCCESS(Status)) + return Status; + } RtlInitAnsiString((PANSI_STRING)&OriginName, "Testapp"); @@ -454,15 +504,6 @@ if (AuthInfo != NULL) RtlFreeHeap(RtlGetProcessHeap(), 0, AuthInfo); - if (LsaHandle != NULL) - { - Status = LsaDeregisterLogonProcess(LsaHandle); - if (!NT_SUCCESS(Status)) - { - TRACE("LsaDeregisterLogonProcess failed (Status 0x%08lx)\n", Status); - } - } - if (!NT_SUCCESS(Status)) { SetLastError(RtlNtStatusToDosError(Status));
11 years
1
0
0
0
[ekohl] 61284: [LSASRV] LsapLogonUser: Copy the local groups SID array from the clients adress space the servers adress space.
by ekohl@svn.reactos.org
Author: ekohl Date: Tue Dec 17 20:56:52 2013 New Revision: 61284 URL:
http://svn.reactos.org/svn/reactos?rev=61284&view=rev
Log: [LSASRV] LsapLogonUser: Copy the local groups SID array from the clients adress space the servers adress space. Modified: trunk/reactos/dll/win32/lsasrv/authpackage.c Modified: trunk/reactos/dll/win32/lsasrv/authpackage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/authpacka…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/authpackage.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/authpackage.c [iso-8859-1] Tue Dec 17 20:56:52 2013 @@ -539,6 +539,54 @@ } +static +NTSTATUS +LsapCopyLocalGroups( + IN PLSAP_LOGON_CONTEXT LogonContext, + IN PTOKEN_GROUPS ClientGroups, + IN ULONG ClientGroupsCount, + OUT PTOKEN_GROUPS *TokenGroups) +{ + ULONG LocalGroupsLength = 0; + PTOKEN_GROUPS LocalGroups = NULL; + NTSTATUS Status; + + LocalGroupsLength = sizeof(TOKEN_GROUPS) + + (ClientGroupsCount - ANYSIZE_ARRAY) * sizeof(SID_AND_ATTRIBUTES); + LocalGroups = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + LocalGroupsLength); + if (LocalGroups == NULL) + { + TRACE("RtlAllocateHeap() failed\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + + Status = NtReadVirtualMemory(LogonContext->ClientProcessHandle, + ClientGroups, + LocalGroups, + LocalGroupsLength, + NULL); + if (!NT_SUCCESS(Status)) + goto done; + + *TokenGroups = LocalGroups; + +done: + if (!NT_SUCCESS(Status)) + { + if (LocalGroups != NULL) + { + RtlFreeHeap(RtlGetProcessHeap(), + 0, + LocalGroups); + } + } + + return Status; +} + + NTSTATUS LsapLogonUser(PLSA_API_MSG RequestMsg, PLSAP_LOGON_CONTEXT LogonContext) @@ -553,6 +601,7 @@ PUNICODE_STRING AuthenticatingAuthority = NULL; PUNICODE_STRING MachineName = NULL; PVOID LocalAuthInfo = NULL; + PTOKEN_GROUPS LocalGroups = NULL; HANDLE TokenHandle = NULL; ULONG i; ULONG PackageId; @@ -594,6 +643,18 @@ RtlFreeHeap(RtlGetProcessHeap(), 0, LocalAuthInfo); return Status; } + } + + if (RequestMsg->LogonUser.Request.LocalGroupsCount > 0) + { + Status = LsapCopyLocalGroups(LogonContext, + RequestMsg->LogonUser.Request.LocalGroups, + RequestMsg->LogonUser.Request.LocalGroupsCount, + &LocalGroups); + if (!NT_SUCCESS(Status)) + goto done; + + TRACE("GroupCount: %lu\n", LocalGroups->GroupCount); } if (Package->LsaApLogonUserEx2 != NULL) @@ -721,6 +782,12 @@ NtClose(TokenHandle); } + /* Free the local groups */ + if (LocalGroups != NULL) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, LocalGroups); + } + /* Free the local authentication info buffer */ if (LocalAuthInfo != NULL) RtlFreeHeap(RtlGetProcessHeap(), 0, LocalAuthInfo); @@ -796,6 +863,8 @@ LsapFreeHeap(MachineName); } + TRACE("LsapLogonUser done (Status 0x%08lx)\n", Status); + return Status; }
11 years
1
0
0
0
[hbelusca] 61283: [NTVDM] Implement basic VDD support: implement the (un)register & dispatch call BOP (called BOP_3RDPARTY): see "Undocumented DOS" by Schulman et al. page 267 (as always ; ) ), as w...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Dec 17 02:19:52 2013 New Revision: 61283 URL:
http://svn.reactos.org/svn/reactos?rev=61283&view=rev
Log: [NTVDM] Implement basic VDD support: implement the (un)register & dispatch call BOP (called BOP_3RDPARTY): see "Undocumented DOS" by Schulman et al. page 267 (as always ;) ), as well as:
http://www.ragestorm.net/tutorial?id=27
- "Tutorial - Calling Win32 from DOS"
http://www.airborn.com.au/layout/vddtest.html
- "DOS to 32 bit DLL under XP - an example" (almost the same explanations as the previous article)
http://sta.c64.org/blog/dosvddaccess.html
- "Accessing Windows device drivers from DOS programs" and... ... your lovely Win2k / Win2k3 DDK section: "Device Technologies/Other Devices/Devices Requiring VDDs" !! Ready to test? :D Added: branches/ntvdm/subsystems/ntvdm/vddsup.c (with props) branches/ntvdm/subsystems/ntvdm/vddsup.h (with props) Modified: branches/ntvdm/subsystems/ntvdm/CMakeLists.txt branches/ntvdm/subsystems/ntvdm/emulator.c Modified: branches/ntvdm/subsystems/ntvdm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/CMakeLis…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] Tue Dec 17 02:19:52 2013 @@ -16,6 +16,7 @@ registers.c speaker.c timer.c + vddsup.c vga.c ntvdm.c ntvdm.rc Modified: branches/ntvdm/subsystems/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Tue Dec 17 02:19:52 2013 @@ -13,6 +13,7 @@ #include "emulator.h" #include "bios.h" #include "bop.h" +#include "vddsup.h" #include "io.h" #include "registers.h" #include "vga.h" @@ -122,6 +123,9 @@ /* Enable interrupts */ setIF(1); + /* Initialize VDD support */ + VDDSupInitialize(); + /* Register the DebugBreak BOP */ RegisterBop(BOP_DEBUGGER, EmulatorDebugBreak); Added: branches/ntvdm/subsystems/ntvdm/vddsup.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vddsup.c…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vddsup.c (added) +++ branches/ntvdm/subsystems/ntvdm/vddsup.c [iso-8859-1] Tue Dec 17 02:19:52 2013 @@ -0,0 +1,236 @@ +/* + * COPYRIGHT: GPL - See COPYING in the top level directory + * PROJECT: ReactOS Virtual DOS Machine + * FILE: vddsup.c + * PURPOSE: Virtual DOS Drivers (VDD) Support + * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) + */ + +/* INCLUDES *******************************************************************/ + +#define NDEBUG + +#include "emulator.h" +#include "vddsup.h" + +#include "bop.h" +#include "registers.h" + +typedef VOID (CDECL *VDD_INIT_PROC)(VOID); +typedef VOID (CDECL *VDD_DISPATCH_PROC)(VOID); + +typedef struct _VDD_MODULE +{ + HMODULE hDll; + VDD_DISPATCH_PROC DispatchRoutine; +} VDD_MODULE, *PVDD_MODULE; + +/* BOP Identifiers */ +#define BOP_3RDPARTY 0x58 // 3rd-party VDD BOP + +/* PRIVATE VARIABLES **********************************************************/ + +#define MAX_VDD_MODULES 0xFF +VDD_MODULE VDDList[MAX_VDD_MODULES] = {{NULL}}; // TODO: Maybe use a linked list. + // But the number of elements must be <= MAXUSHORT + +/* PRIVATE FUNCTIONS **********************************************************/ + +USHORT GetNextFreeVDDEntry(VOID) +{ + USHORT Entry = MAX_VDD_MODULES; + for (Entry = 0; Entry < sizeof(VDDList)/sizeof(VDDList[0]); ++Entry) + { + if (VDDList[Entry].hDll == NULL) break; + } + return Entry; +} + +VOID WINAPI ThirdPartyVDDBop(LPWORD Stack) +{ + /* Get the Function Number and skip it */ + BYTE FuncNum = *(PBYTE)SEG_OFF_TO_PTR(getCS(), getIP()); + setIP(getIP() + 1); + + switch (FuncNum) + { + /* RegisterModule */ + case 0: + { + BOOL Success = TRUE; + WORD RetVal = 0; + WORD Entry = 0; + LPCSTR DllName = NULL, + InitRoutineName = NULL, + DispatchRoutineName = NULL; + HMODULE hDll = NULL; + VDD_INIT_PROC InitRoutine = NULL; + VDD_DISPATCH_PROC DispatchRoutine = NULL; + + DPRINT1("RegisterModule() called\n"); + + /* Clear the Carry Flag (no error happened so far) */ + setCF(0); + + /* Retrieve the VDD name in DS:SI */ + DllName = SEG_OFF_TO_PTR(getDS(), getSI()); + + /* Retrieve the initialization routine API name in ES:DI (optional --> ES=DI=0) */ + if (getES() != 0 || getDI() != 0) + InitRoutineName = SEG_OFF_TO_PTR(getES(), getDI()); + + /* Retrieve the dispatch routine API name in DS:BX */ + DispatchRoutineName = SEG_OFF_TO_PTR(getDS(), getBX()); + + DPRINT1("DllName = '%s' - InitRoutineName = '%s' - DispatchRoutineName = '%s'\n", + (DllName ? DllName : "n/a"), + (InitRoutineName ? InitRoutineName : "n/a"), + (DispatchRoutineName ? DispatchRoutineName : "n/a")); + + /* Load the VDD DLL */ + hDll = LoadLibraryA(DllName); + if (hDll == NULL) + { + DWORD LastError = GetLastError(); + Success = FALSE; + + if (LastError == ERROR_NOT_ENOUGH_MEMORY) + { + DPRINT1("Not enough memory to load DLL '%s'\n", DllName); + RetVal = 4; + goto Quit; + } + else + { + DPRINT1("Failed to load DLL '%s'; last error = %d\n", DllName, LastError); + RetVal = 1; + goto Quit; + } + } + + /* Load the initialization routine if needed */ + if (InitRoutineName) + { + InitRoutine = (VDD_INIT_PROC)GetProcAddress(hDll, InitRoutineName); + if (InitRoutine == NULL) + { + DPRINT1("Failed to load the initialization routine '%s'\n", InitRoutineName); + Success = FALSE; + RetVal = 3; + goto Quit; + } + } + + /* Load the dispatch routine */ + DispatchRoutine = (VDD_DISPATCH_PROC)GetProcAddress(hDll, DispatchRoutineName); + if (DispatchRoutine == NULL) + { + DPRINT1("Failed to load the dispatch routine '%s'\n", DispatchRoutineName); + Success = FALSE; + RetVal = 2; + goto Quit; + } + + /* If we arrived there, that means everything is OK */ + + /* Register the VDD DLL */ + Entry = GetNextFreeVDDEntry(); + if (Entry == MAX_VDD_MODULES) + { + DPRINT1("Failed to create a new VDD module entry\n"); + Success = FALSE; + RetVal = 4; + goto Quit; + } + VDDList[Entry].hDll = hDll; + VDDList[Entry].DispatchRoutine = DispatchRoutine; + + /* Call the initialization routine if needed */ + if (InitRoutine) InitRoutine(); + + /* We succeeded */ + Success = TRUE; + RetVal = Entry; + +Quit: + if (!Success) + { + /* Unload the VDD DLL */ + if (hDll) FreeLibrary(hDll); + + /* Set the Carry Flag to indicate that an error happened */ + setCF(1); + } + // else + // { + // /* Clear the Carry Flag (success) */ + // setCF(0); + // } + setAX(RetVal); + break; + } + + /* UnRegisterModule */ + case 1: + { + WORD Entry = getAX(); + + DPRINT1("UnRegisterModule() called\n"); + + /* Sanity checks */ + if (Entry > MAX_VDD_MODULES || VDDList[Entry].hDll == NULL) + { + DPRINT1("Invalid VDD DLL Handle: %d\n", Entry); + /* Stop the VDM */ + VdmRunning = FALSE; + return; + } + + /* Unregister the VDD DLL */ + FreeLibrary(VDDList[Entry].hDll); + VDDList[Entry].hDll = NULL; + VDDList[Entry].DispatchRoutine = NULL; + break; + } + + /* DispatchCall */ + case 2: + { + WORD Entry = getAX(); + + DPRINT1("DispatchCall() called\n"); + + /* Sanity checks */ + if (Entry > MAX_VDD_MODULES || + VDDList[Entry].hDll == NULL || + VDDList[Entry].DispatchRoutine == NULL) + { + DPRINT1("Invalid VDD DLL Handle: %d\n", Entry); + /* Stop the VDM */ + VdmRunning = FALSE; + return; + } + + /* Call the dispatch routine */ + VDDList[Entry].DispatchRoutine(); + break; + } + + default: + { + DPRINT1("Unknown 3rd-party VDD BOP Function: 0x%02X\n", FuncNum); + setCF(1); + break; + } + } +} + +/* PUBLIC FUNCTIONS ***********************************************************/ + +VOID VDDSupInitialize(VOID) +{ + /* Register the 3rd-party VDD BOP Handler */ + RegisterBop(BOP_3RDPARTY, ThirdPartyVDDBop); +} + +/* EOF */ Propchange: branches/ntvdm/subsystems/ntvdm/vddsup.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ntvdm/subsystems/ntvdm/vddsup.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vddsup.h…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vddsup.h (added) +++ branches/ntvdm/subsystems/ntvdm/vddsup.h [iso-8859-1] Tue Dec 17 02:19:52 2013 @@ -0,0 +1,20 @@ +/* + * COPYRIGHT: GPL - See COPYING in the top level directory + * PROJECT: ReactOS Virtual DOS Machine + * FILE: vddsup.h + * PURPOSE: Virtual DOS Drivers (VDD) Support + * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) + */ + +#ifndef _VDDSUP_H_ +#define _VDDSUP_H_ + +/* DEFINES ********************************************************************/ + +/* FUNCTIONS ******************************************************************/ + +VOID VDDSupInitialize(VOID); + +#endif // _VDDSUP_H_ + +/* EOF */ Propchange: branches/ntvdm/subsystems/ntvdm/vddsup.h ------------------------------------------------------------------------------ svn:eol-style = native
11 years
1
0
0
0
[hbelusca] 61282: [NTVDM]: Implement BOP_DEBUGGER (see: "Undocumented DOS" by Schulman et al., page 267) which allows you to break into a debugger from a 16-bit app (Vampyre, it can be useful for y...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Mon Dec 16 23:57:35 2013 New Revision: 61282 URL:
http://svn.reactos.org/svn/reactos?rev=61282&view=rev
Log: [NTVDM]: Implement BOP_DEBUGGER (see: "Undocumented DOS" by Schulman et al., page 267) which allows you to break into a debugger from a 16-bit app (Vampyre, it can be useful for you ;) ). Modified: branches/ntvdm/subsystems/ntvdm/emulator.c Modified: branches/ntvdm/subsystems/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Mon Dec 16 23:57:35 2013 @@ -23,6 +23,9 @@ FAST486_STATE EmulatorContext; static BOOLEAN A20Line = FALSE; + +/* BOP Identifiers */ +#define BOP_DEBUGGER 0x56 // Break into the debugger from a 16-bit app /* PRIVATE FUNCTIONS **********************************************************/ @@ -91,6 +94,12 @@ return PicGetInterrupt(); } +VOID WINAPI EmulatorDebugBreak(LPWORD Stack) +{ + DPRINT1("NTVDM: BOP_DEBUGGER\n"); + DebugBreak(); +} + /* PUBLIC FUNCTIONS ***********************************************************/ BOOLEAN EmulatorInitialize(VOID) @@ -112,6 +121,9 @@ /* Enable interrupts */ setIF(1); + + /* Register the DebugBreak BOP */ + RegisterBop(BOP_DEBUGGER, EmulatorDebugBreak); return TRUE; }
11 years
1
0
0
0
[ekohl] 61281: [ADVAPI32] - Remove the old logon code. It is not needed any longer. - LogonUserW: Pass two SIDs (LogonSid and LocalSid) to LsaLogonUser. - LogonUserW: Use a better token source name.
by ekohl@svn.reactos.org
Author: ekohl Date: Mon Dec 16 14:03:46 2013 New Revision: 61281 URL:
http://svn.reactos.org/svn/reactos?rev=61281&view=rev
Log: [ADVAPI32] - Remove the old logon code. It is not needed any longer. - LogonUserW: Pass two SIDs (LogonSid and LocalSid) to LsaLogonUser. - LogonUserW: Use a better token source name. Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c Modified: trunk/reactos/dll/win32/advapi32/misc/logon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/misc/lo…
============================================================================== --- trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/misc/logon.c [iso-8859-1] Mon Dec 16 14:03:46 2013 @@ -8,8 +8,6 @@ #include <advapi32.h> WINE_DEFAULT_DEBUG_CHANNEL(advapi); - -#define NEW_LOGON /* FUNCTIONS ***************************************************************/ @@ -64,7 +62,7 @@ /* Resume the main thread */ if (!(dwCreationFlags & CREATE_SUSPENDED)) { - ResumeThread(lpProcessInformation->hThread); + ResumeThread(lpProcessInformation->hThread); } return TRUE; @@ -213,365 +211,8 @@ } -#ifndef NEW_LOGON -static BOOL WINAPI -GetAccountDomainSid(PSID *Sid) -{ - PPOLICY_ACCOUNT_DOMAIN_INFO Info = NULL; - LSA_OBJECT_ATTRIBUTES ObjectAttributes; - LSA_HANDLE PolicyHandle; - PSID lpSid; - ULONG Length; - NTSTATUS Status; - - *Sid = NULL; - - memset(&ObjectAttributes, 0, sizeof(LSA_OBJECT_ATTRIBUTES)); - ObjectAttributes.Length = sizeof(LSA_OBJECT_ATTRIBUTES); - - Status = LsaOpenPolicy(NULL, - &ObjectAttributes, - POLICY_VIEW_LOCAL_INFORMATION, - &PolicyHandle); - if (!NT_SUCCESS(Status)) - { - ERR("LsaOpenPolicy failed (Status: 0x%08lx)\n", Status); - return FALSE; - } - - Status = LsaQueryInformationPolicy(PolicyHandle, - PolicyAccountDomainInformation, - (PVOID *)&Info); - if (!NT_SUCCESS(Status)) - { - ERR("LsaQueryInformationPolicy failed (Status: 0x%08lx)\n", Status); - LsaClose(PolicyHandle); - return FALSE; - } - - Length = RtlLengthSid(Info->DomainSid); - - lpSid = RtlAllocateHeap(RtlGetProcessHeap(), - 0, - Length); - if (lpSid == NULL) - { - ERR("Failed to allocate SID buffer!\n"); - LsaFreeMemory(Info); - LsaClose(PolicyHandle); - return FALSE; - } - - memcpy(lpSid, Info->DomainSid, Length); - - *Sid = lpSid; - - LsaFreeMemory(Info); - LsaClose(PolicyHandle); - - return TRUE; -} - - -static PSID -AppendRidToSid(PSID SrcSid, - ULONG Rid) -{ - ULONG Rids[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - UCHAR RidCount; - PSID DstSid; - ULONG i; - - RidCount = *RtlSubAuthorityCountSid(SrcSid); - if (RidCount >= 8) - return NULL; - - for (i = 0; i < RidCount; i++) - Rids[i] = *RtlSubAuthoritySid(SrcSid, i); - - Rids[RidCount] = Rid; - RidCount++; - - RtlAllocateAndInitializeSid(RtlIdentifierAuthoritySid(SrcSid), - RidCount, - Rids[0], - Rids[1], - Rids[2], - Rids[3], - Rids[4], - Rids[5], - Rids[6], - Rids[7], - &DstSid); - - return DstSid; -} - - -static BOOL WINAPI -GetUserSid(LPCWSTR UserName, - PSID *Sid) -{ - PSID SidBuffer = NULL; - PWSTR DomainBuffer = NULL; - DWORD cbSidSize = 0; - DWORD cchDomSize = 0; - SID_NAME_USE Use; - BOOL res = TRUE; - - *Sid = NULL; - - LookupAccountNameW(NULL, - UserName, - NULL, - &cbSidSize, - NULL, - &cchDomSize, - &Use); - - if (cbSidSize == 0 || cchDomSize == 0) - return FALSE; - - SidBuffer = RtlAllocateHeap(RtlGetProcessHeap(), - HEAP_ZERO_MEMORY, - cbSidSize); - if (SidBuffer == NULL) - return FALSE; - - DomainBuffer = RtlAllocateHeap(RtlGetProcessHeap(), - HEAP_ZERO_MEMORY, - cchDomSize * sizeof(WCHAR)); - if (DomainBuffer == NULL) - { - res = FALSE; - goto done; - } - - if (!LookupAccountNameW(NULL, - UserName, - SidBuffer, - &cbSidSize, - DomainBuffer, - &cchDomSize, - &Use)) - { - res = FALSE; - goto done; - } - - if (Use != SidTypeUser) - { - res = FALSE; - goto done; - } - - *Sid = SidBuffer; - -done: - if (DomainBuffer != NULL) - RtlFreeHeap(RtlGetProcessHeap(), 0, DomainBuffer); - - if (res == FALSE) - { - if (SidBuffer != NULL) - RtlFreeHeap(RtlGetProcessHeap(), 0, SidBuffer); - } - - return res; -} - - -static PTOKEN_GROUPS -AllocateGroupSids(OUT PSID *PrimaryGroupSid, - OUT PSID *OwnerSid) -{ - SID_IDENTIFIER_AUTHORITY WorldAuthority = {SECURITY_WORLD_SID_AUTHORITY}; - SID_IDENTIFIER_AUTHORITY LocalAuthority = {SECURITY_LOCAL_SID_AUTHORITY}; - SID_IDENTIFIER_AUTHORITY SystemAuthority = {SECURITY_NT_AUTHORITY}; - PTOKEN_GROUPS TokenGroups; -#define MAX_GROUPS 8 - DWORD GroupCount = 0; - PSID DomainSid; - PSID Sid; - LUID Luid; - NTSTATUS Status; - - Status = NtAllocateLocallyUniqueId(&Luid); - if (!NT_SUCCESS(Status)) - return NULL; - - if (!GetAccountDomainSid(&DomainSid)) - return NULL; - - TokenGroups = RtlAllocateHeap( - GetProcessHeap(), 0, - sizeof(TOKEN_GROUPS) + - MAX_GROUPS * sizeof(SID_AND_ATTRIBUTES)); - if (TokenGroups == NULL) - { - RtlFreeHeap(RtlGetProcessHeap(), 0, DomainSid); - return NULL; - } - - Sid = AppendRidToSid(DomainSid, DOMAIN_GROUP_RID_USERS); - RtlFreeHeap(RtlGetProcessHeap(), 0, DomainSid); - - /* Member of the domain */ - TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = - SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; - *PrimaryGroupSid = Sid; - GroupCount++; - - /* Member of 'Everyone' */ - RtlAllocateAndInitializeSid(&WorldAuthority, - 1, - SECURITY_WORLD_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); - TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = - SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; - GroupCount++; - -#if 1 - /* Member of 'Administrators' */ - RtlAllocateAndInitializeSid(&SystemAuthority, - 2, - SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); - TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = - SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; - GroupCount++; -#else - TRACE("Not adding user to Administrators group\n"); -#endif - - /* Member of 'Users' */ - RtlAllocateAndInitializeSid(&SystemAuthority, - 2, - SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_USERS, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); - TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = - SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; - GroupCount++; - - /* Logon SID */ - RtlAllocateAndInitializeSid(&SystemAuthority, - SECURITY_LOGON_IDS_RID_COUNT, - SECURITY_LOGON_IDS_RID, - Luid.HighPart, - Luid.LowPart, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); - TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = - SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY | SE_GROUP_LOGON_ID; - GroupCount++; - *OwnerSid = Sid; - - /* Member of 'Local users */ - RtlAllocateAndInitializeSid(&LocalAuthority, - 1, - SECURITY_LOCAL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); - TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = - SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; - GroupCount++; - - /* Member of 'Interactive users' */ - RtlAllocateAndInitializeSid(&SystemAuthority, - 1, - SECURITY_INTERACTIVE_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); - TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = - SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; - GroupCount++; - - /* Member of 'Authenticated users' */ - RtlAllocateAndInitializeSid(&SystemAuthority, - 1, - SECURITY_AUTHENTICATED_USER_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &Sid); - TokenGroups->Groups[GroupCount].Sid = Sid; - TokenGroups->Groups[GroupCount].Attributes = - SE_GROUP_ENABLED | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_MANDATORY; - GroupCount++; - - TokenGroups->GroupCount = GroupCount; - ASSERT(TokenGroups->GroupCount <= MAX_GROUPS); - - return TokenGroups; -} - - -static VOID -FreeGroupSids(PTOKEN_GROUPS TokenGroups) -{ - ULONG i; - - for (i = 0; i < TokenGroups->GroupCount; i++) - { - if (TokenGroups->Groups[i].Sid != NULL) - RtlFreeHeap(GetProcessHeap(), 0, TokenGroups->Groups[i].Sid); - } - - RtlFreeHeap(GetProcessHeap(), 0, TokenGroups); -} -#endif - - -/* - * @unimplemented +/* + * @implemented */ BOOL WINAPI LogonUserW(LPWSTR lpszUsername, @@ -581,13 +222,15 @@ DWORD dwLogonProvider, PHANDLE phToken) { -#ifdef NEW_LOGON + SID_IDENTIFIER_AUTHORITY LocalAuthority = {SECURITY_LOCAL_SID_AUTHORITY}; + SID_IDENTIFIER_AUTHORITY SystemAuthority = {SECURITY_NT_AUTHORITY}; LSA_STRING LogonProcessName; LSA_STRING PackageName; HANDLE LsaHandle = NULL; LSA_OPERATIONAL_MODE SecurityMode = 0; ULONG AuthenticationPackage = 0; - + PSID LogonSid = NULL; + PSID LocalSid = NULL; LSA_STRING OriginName; UNICODE_STRING DomainName; UNICODE_STRING UserName; @@ -596,10 +239,11 @@ ULONG AuthInfoLength; ULONG_PTR Ptr; TOKEN_SOURCE TokenSource; - + PTOKEN_GROUPS TokenGroups = NULL; PMSV1_0_INTERACTIVE_PROFILE ProfileBuffer = NULL; ULONG ProfileBufferLength = 0; LUID Luid = {0, 0}; + LUID LogonId = {0, 0}; HANDLE TokenHandle = NULL; QUOTA_LIMITS QuotaLimits; NTSTATUS SubStatus = STATUS_SUCCESS; @@ -659,7 +303,6 @@ Status = STATUS_INSUFFICIENT_RESOURCES; goto done; } - AuthInfo->MessageType = MsV1_0InteractiveLogon; @@ -695,9 +338,57 @@ Password.Buffer, Password.MaximumLength); - /* FIXME: Add LocalGroups here */ - - strcpy(TokenSource.SourceName, "Bla"); + /* Create the Logon SID*/ + AllocateLocallyUniqueId(&LogonId); + Status = RtlAllocateAndInitializeSid(&SystemAuthority, + SECURITY_LOGON_IDS_RID_COUNT, + SECURITY_LOGON_IDS_RID, + LogonId.HighPart, + LogonId.LowPart, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + &LogonSid); + if (!NT_SUCCESS(Status)) + goto done; + + /* Create the Local SID*/ + Status = RtlAllocateAndInitializeSid(&LocalAuthority, + 1, + SECURITY_LOCAL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + SECURITY_NULL_RID, + &LocalSid); + if (!NT_SUCCESS(Status)) + goto done; + + /* Allocate and set the token groups */ + TokenGroups = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(TOKEN_GROUPS) + ((2 - ANYSIZE_ARRAY) * sizeof(SID_AND_ATTRIBUTES))); + if (TokenGroups == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + TokenGroups->GroupCount = 2; + TokenGroups->Groups[0].Sid = LogonSid; + TokenGroups->Groups[0].Attributes = SE_GROUP_MANDATORY | SE_GROUP_ENABLED | + SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_LOGON_ID; + TokenGroups->Groups[1].Sid = LocalSid; + TokenGroups->Groups[1].Attributes = SE_GROUP_MANDATORY | SE_GROUP_ENABLED | + SE_GROUP_ENABLED_BY_DEFAULT; + + /* Set the token source */ + strcpy(TokenSource.SourceName, "LogonUser"); AllocateLocallyUniqueId(&TokenSource.SourceIdentifier); Status = LsaLogonUser(LsaHandle, @@ -706,7 +397,7 @@ AuthenticationPackage, (PVOID)AuthInfo, AuthInfoLength, - NULL, /* LocalGroups */ + TokenGroups, &TokenSource, (PVOID*)&ProfileBuffer, &ProfileBufferLength, @@ -751,6 +442,15 @@ CloseHandle(TokenHandle); } + if (TokenGroups != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, TokenGroups); + + if (LocalSid != NULL) + RtlFreeSid(LocalSid); + + if (LogonSid != NULL) + RtlFreeSid(LogonSid); + if (AuthInfo != NULL) RtlFreeHeap(RtlGetProcessHeap(), 0, AuthInfo); @@ -770,206 +470,6 @@ } return TRUE; -#else - /* FIXME shouldn't use hard-coded list of privileges */ - static struct - { - LPCWSTR PrivName; - DWORD Attributes; - } - DefaultPrivs[] = - { - { L"SeMachineAccountPrivilege", 0 }, - { L"SeSecurityPrivilege", 0 }, - { L"SeTakeOwnershipPrivilege", 0 }, - { L"SeLoadDriverPrivilege", 0 }, - { L"SeSystemProfilePrivilege", 0 }, - { L"SeSystemtimePrivilege", 0 }, - { L"SeProfileSingleProcessPrivilege", 0 }, - { L"SeIncreaseBasePriorityPrivilege", 0 }, - { L"SeCreatePagefilePrivilege", 0 }, - { L"SeBackupPrivilege", 0 }, - { L"SeRestorePrivilege", 0 }, - { L"SeShutdownPrivilege", 0 }, - { L"SeDebugPrivilege", 0 }, - { L"SeSystemEnvironmentPrivilege", 0 }, - { L"SeChangeNotifyPrivilege", SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_ENABLED_BY_DEFAULT }, - { L"SeRemoteShutdownPrivilege", 0 }, - { L"SeUndockPrivilege", 0 }, - { L"SeEnableDelegationPrivilege", 0 }, - { L"SeImpersonatePrivilege", SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_ENABLED_BY_DEFAULT }, - { L"SeCreateGlobalPrivilege", SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_ENABLED_BY_DEFAULT } - }; - OBJECT_ATTRIBUTES ObjectAttributes; - SECURITY_QUALITY_OF_SERVICE Qos; - TOKEN_USER TokenUser; - TOKEN_OWNER TokenOwner; - TOKEN_PRIMARY_GROUP TokenPrimaryGroup; - PTOKEN_GROUPS TokenGroups = NULL; - PTOKEN_PRIVILEGES TokenPrivileges = NULL; - TOKEN_DEFAULT_DACL TokenDefaultDacl; - LARGE_INTEGER ExpirationTime; - LUID AuthenticationId; - TOKEN_SOURCE TokenSource; - PSID UserSid = NULL; - PSID PrimaryGroupSid = NULL; - PSID OwnerSid = NULL; - PSID LocalSystemSid; - PACL Dacl = NULL; - SID_IDENTIFIER_AUTHORITY SystemAuthority = {SECURITY_NT_AUTHORITY}; - unsigned i; - NTSTATUS Status = STATUS_SUCCESS; - - Qos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE); - Qos.ImpersonationLevel = SecurityAnonymous; - Qos.ContextTrackingMode = SECURITY_STATIC_TRACKING; - Qos.EffectiveOnly = FALSE; - - ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES); - ObjectAttributes.RootDirectory = NULL; - ObjectAttributes.ObjectName = NULL; - ObjectAttributes.Attributes = 0; - ObjectAttributes.SecurityDescriptor = NULL; - ObjectAttributes.SecurityQualityOfService = &Qos; - - Status = NtAllocateLocallyUniqueId(&AuthenticationId); - if (!NT_SUCCESS(Status)) - { - return FALSE; - } - - ExpirationTime.QuadPart = -1; - - /* Get the user SID from the registry */ - if (!GetUserSid (lpszUsername, &UserSid)) - { - ERR("GetUserSid() failed\n"); - return FALSE; - } - - TokenUser.User.Sid = UserSid; - TokenUser.User.Attributes = 0; - - /* Allocate and initialize token groups */ - TokenGroups = AllocateGroupSids(&PrimaryGroupSid, - &OwnerSid); - if (TokenGroups == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto done; - } - - /* Allocate and initialize token privileges */ - TokenPrivileges = RtlAllocateHeap(GetProcessHeap(), 0, - sizeof(TOKEN_PRIVILEGES) - + sizeof(DefaultPrivs) / sizeof(DefaultPrivs[0]) - * sizeof(LUID_AND_ATTRIBUTES)); - if (TokenPrivileges == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto done; - } - - TokenPrivileges->PrivilegeCount = 0; - for (i = 0; i < sizeof(DefaultPrivs) / sizeof(DefaultPrivs[0]); i++) - { - if (! LookupPrivilegeValueW(NULL, - DefaultPrivs[i].PrivName, - &TokenPrivileges->Privileges[TokenPrivileges->PrivilegeCount].Luid)) - { - WARN("Can't set privilege %S\n", DefaultPrivs[i].PrivName); - } - else - { - TokenPrivileges->Privileges[TokenPrivileges->PrivilegeCount].Attributes = DefaultPrivs[i].Attributes; - TokenPrivileges->PrivilegeCount++; - } - } - - TokenOwner.Owner = OwnerSid; - TokenPrimaryGroup.PrimaryGroup = PrimaryGroupSid; - - Dacl = RtlAllocateHeap(GetProcessHeap(), 0, 1024); - if (Dacl == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto done; - } - - Status = RtlCreateAcl(Dacl, 1024, ACL_REVISION); - if (!NT_SUCCESS(Status)) - goto done; - - RtlAddAccessAllowedAce(Dacl, - ACL_REVISION, - GENERIC_ALL, - OwnerSid); - - RtlAllocateAndInitializeSid(&SystemAuthority, - 1, - SECURITY_LOCAL_SYSTEM_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - SECURITY_NULL_RID, - &LocalSystemSid); - - /* SID: S-1-5-18 */ - RtlAddAccessAllowedAce(Dacl, - ACL_REVISION, - GENERIC_ALL, - LocalSystemSid); - - RtlFreeSid(LocalSystemSid); - - TokenDefaultDacl.DefaultDacl = Dacl; - - memcpy(TokenSource.SourceName, - "User32 ", - 8); - - Status = NtAllocateLocallyUniqueId(&TokenSource.SourceIdentifier); - if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(GetProcessHeap(), 0, Dacl); - FreeGroupSids(TokenGroups); - RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges); - RtlFreeSid(UserSid); - return FALSE; - } - - Status = NtCreateToken(phToken, - TOKEN_ALL_ACCESS, - &ObjectAttributes, - TokenPrimary, - &AuthenticationId, - &ExpirationTime, - &TokenUser, - TokenGroups, - TokenPrivileges, - &TokenOwner, - &TokenPrimaryGroup, - &TokenDefaultDacl, - &TokenSource); - -done: - if (Dacl != NULL) - RtlFreeHeap(GetProcessHeap(), 0, Dacl); - - if (TokenGroups != NULL) - FreeGroupSids(TokenGroups); - - if (TokenPrivileges != NULL) - RtlFreeHeap(GetProcessHeap(), 0, TokenPrivileges); - - if (UserSid != NULL) - RtlFreeHeap(GetProcessHeap(), 0, UserSid); - - return NT_SUCCESS(Status); -#endif } /* EOF */
11 years
1
0
0
0
[tfaber] 61280: [SPEC2DEF] - Fix the order of NONAME/PRIVATE/DATA in def file output
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Dec 15 22:01:53 2013 New Revision: 61280 URL:
http://svn.reactos.org/svn/reactos?rev=61280&view=rev
Log: [SPEC2DEF] - Fix the order of NONAME/PRIVATE/DATA in def file output Modified: trunk/reactos/tools/spec2def/spec2def.c Modified: trunk/reactos/tools/spec2def/spec2def.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/spec2def/spec2def.c?…
============================================================================== --- trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] (original) +++ trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] Sun Dec 15 22:01:53 2013 @@ -481,19 +481,19 @@ fprintf(fileDest, " @%d", pexp->nOrdinal); } + if (pexp->uFlags & FL_NONAME) + { + fprintf(fileDest, " NONAME"); + } + + if (pexp->uFlags & FL_PRIVATE) + { + fprintf(fileDest, " PRIVATE"); + } + if (pexp->nCallingConvention == CC_EXTERN) { fprintf(fileDest, " DATA"); - } - - if (pexp->uFlags & FL_PRIVATE) - { - fprintf(fileDest, " PRIVATE"); - } - - if (pexp->uFlags & FL_NONAME) - { - fprintf(fileDest, " NONAME"); } fprintf(fileDest, "\n");
11 years
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
31
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
Results per page:
10
25
50
100
200