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
January 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
28 participants
703 discussions
Start a n
N
ew thread
[ekohl] 12864: RtlCutoverTimeToSystemTime(): The 4th argument determines whether the cutover time of the current year or the next cutover time is calculated.
by ekohl@svn.reactos.com
RtlCutoverTimeToSystemTime(): The 4th argument determines whether the cutover time of the current year or the next cutover time is calculated. Modified: trunk/reactos/include/ntos/rtl.h Modified: trunk/reactos/lib/rtl/time.c _____ Modified: trunk/reactos/include/ntos/rtl.h --- trunk/reactos/include/ntos/rtl.h 2005-01-07 09:21:53 UTC (rev 12863) +++ trunk/reactos/include/ntos/rtl.h 2005-01-07 12:58:46 UTC (rev 12864) @@ -112,7 +112,7 @@ InsertHeadList( IN PLIST_ENTRY ListHead, IN PLIST_ENTRY Entry) -{ +{ PLIST_ENTRY OldFlink; OldFlink = ListHead->Flink; Entry->Flink = OldFlink; @@ -140,7 +140,7 @@ InsertTailList( IN PLIST_ENTRY ListHead, IN PLIST_ENTRY Entry) -{ +{ PLIST_ENTRY OldBlink; OldBlink = ListHead->Blink; Entry->Flink = ListHead; @@ -882,7 +882,7 @@ RtlCutoverTimeToSystemTime(IN PTIME_FIELDS CutoverTimeFields, OUT PLARGE_INTEGER SystemTime, IN PLARGE_INTEGER CurrentTime, - IN ULONG Unknown); + IN BOOLEAN ThisYearsCutoverOnly); NTSTATUS STDCALL RtlDecompressBuffer(IN USHORT CompressionFormat, _____ Modified: trunk/reactos/lib/rtl/time.c --- trunk/reactos/lib/rtl/time.c 2005-01-07 09:21:53 UTC (rev 12863) +++ trunk/reactos/lib/rtl/time.c 2005-01-07 12:58:46 UTC (rev 12864) @@ -74,7 +74,7 @@ RtlCutoverTimeToSystemTime(IN PTIME_FIELDS CutoverTimeFields, OUT PLARGE_INTEGER SystemTime, IN PLARGE_INTEGER CurrentTime, - IN ULONG Unknown) + IN BOOLEAN ThisYearsCutoverOnly) { TIME_FIELDS AdjustedTimeFields; TIME_FIELDS CurrentTimeFields; @@ -82,6 +82,7 @@ LARGE_INTEGER CutoverSystemTime; CSHORT MonthLength; CSHORT Days; + BOOLEAN NextYearsCutover = FALSE; /* Check fixed cutover time */ if (CutoverTimeFields->Year != 0) @@ -105,45 +106,60 @@ RtlTimeToTimeFields(CurrentTime, &CurrentTimeFields); - /* Compute the cutover time of the first day of the current month */ - AdjustedTimeFields.Year = CurrentTimeFields.Year; - AdjustedTimeFields.Month = CutoverTimeFields->Month; - AdjustedTimeFields.Day = 1; - AdjustedTimeFields.Hour = CutoverTimeFields->Hour; - AdjustedTimeFields.Minute = CutoverTimeFields->Minute; - AdjustedTimeFields.Second = CutoverTimeFields->Second; - AdjustedTimeFields.Milliseconds = CutoverTimeFields->Milliseconds; + while (TRUE) + { + /* Compute the cutover time of the first day of the current month */ + AdjustedTimeFields.Year = CurrentTimeFields.Year; + if (NextYearsCutover == TRUE) + AdjustedTimeFields.Year++; - if (!RtlTimeFieldsToTime(&AdjustedTimeFields, &CutoverSystemTime)) - return FALSE; + AdjustedTimeFields.Month = CutoverTimeFields->Month; + AdjustedTimeFields.Day = 1; + AdjustedTimeFields.Hour = CutoverTimeFields->Hour; + AdjustedTimeFields.Minute = CutoverTimeFields->Minute; + AdjustedTimeFields.Second = CutoverTimeFields->Second; + AdjustedTimeFields.Milliseconds = CutoverTimeFields->Milliseconds; - RtlTimeToTimeFields(&CutoverSystemTime, &CutoverSystemTimeFields); + if (!RtlTimeFieldsToTime(&AdjustedTimeFields, &CutoverSystemTime)) + return FALSE; - /* Adjust day to first matching weekday */ - if (CutoverSystemTimeFields.Weekday != CutoverTimeFields->Weekday) - { - if (CutoverSystemTimeFields.Weekday < CutoverTimeFields->Weekday) - Days = CutoverTimeFields->Weekday - CutoverSystemTimeFields.Weekday; - else - Days = DAYSPERWEEK - (CutoverSystemTimeFields.Weekday - CutoverTimeFields->Weekday); + RtlTimeToTimeFields(&CutoverSystemTime, &CutoverSystemTimeFields); - AdjustedTimeFields.Day += Days; - } + /* Adjust day to first matching weekday */ + if (CutoverSystemTimeFields.Weekday != CutoverTimeFields->Weekday) + { + if (CutoverSystemTimeFields.Weekday < CutoverTimeFields->Weekday) + Days = CutoverTimeFields->Weekday - CutoverSystemTimeFields.Weekday; + else + Days = DAYSPERWEEK - (CutoverSystemTimeFields.Weekday - CutoverTimeFields->Weekday); - /* Adjust the number of weeks */ - if (CutoverTimeFields->Day > 1) - { - Days = DAYSPERWEEK * (CutoverTimeFields->Day - 1); - MonthLength = MonthLengths[IsLeapYear(AdjustedTimeFields.Year)][AdjustedTimeFields.Mon th - 1]; - if ((AdjustedTimeFields.Day + Days) > MonthLength) - Days -= DAYSPERWEEK; + AdjustedTimeFields.Day += Days; + } - AdjustedTimeFields.Day += Days; + /* Adjust the number of weeks */ + if (CutoverTimeFields->Day > 1) + { + Days = DAYSPERWEEK * (CutoverTimeFields->Day - 1); + MonthLength = MonthLengths[IsLeapYear(AdjustedTimeFields.Year)][AdjustedTimeFields.Mon th - 1]; + if ((AdjustedTimeFields.Day + Days) > MonthLength) + Days -= DAYSPERWEEK; + + AdjustedTimeFields.Day += Days; + } + + if (!RtlTimeFieldsToTime(&AdjustedTimeFields, &CutoverSystemTime)) + return FALSE; + + if (ThisYearsCutoverOnly == TRUE || + NextYearsCutover == TRUE || + CutoverSystemTime.QuadPart >= CurrentTime->QuadPart) + { + break; + } + + NextYearsCutover = TRUE; } - if (!RtlTimeFieldsToTime(&AdjustedTimeFields, &CutoverSystemTime)) - return FALSE; - SystemTime->QuadPart = CutoverSystemTime.QuadPart; return TRUE;
19 years, 11 months
1
0
0
0
[mf] 12863: add svn:ingore
by mf@svn.reactos.com
add svn:ingore Property changes on: trunk/reactos/apps/utils/net/ftp ___________________________________________________________________ Name: svn:ignore + *.sys *.exe *.dll *.cpl *.a *.o *.d *.coff *.dsp *.dsw *.aps *.ncb *.opt *.sym *.plg *.bak *.map
19 years, 11 months
1
0
0
0
[ion] 12862: Remove /nt directory, part two.
by ion@svn.reactos.com
Remove /nt directory, part two. Deleted: trunk/reactos/ntoskrnl/ke/zw.c Deleted: trunk/reactos/ntoskrnl/nt/ _____ Deleted: trunk/reactos/ntoskrnl/ke/zw.c --- trunk/reactos/ntoskrnl/ke/zw.c 2005-01-07 06:54:27 UTC (rev 12861) +++ trunk/reactos/ntoskrnl/ke/zw.c 2005-01-07 06:57:30 UTC (rev 12862) @@ -1,244 +0,0 @@ -/* Machine generated, don't edit */ - -#ifdef __cplusplus -#define EXTERN_C extern "C" -#else -#define EXTERN_C -#endif - -EXTERN_C static __inline__ __attribute__((regparm(2)))void*ZwRosSystemServiceThunk(long n,void*a){void*ret;__asm__("int $0x2E":"=a"(ret):"a"(n),"d"(a));return ret;} -EXTERN_C void*__stdcall ZwAcceptConnectPort(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(vo id)a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(0,&a0);} -EXTERN_C void*__stdcall ZwAccessCheck(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6,vo id*a7){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;(void)a7;re turn ZwRosSystemServiceThunk(1,&a0);} -EXTERN_C void*__stdcall ZwAccessCheckAndAuditAlarm(void*a0,void*a1,void*a2,void*a3,void*a4,void* a5,void*a6,void*a7,void*a8,void*a9,void*a10){(void)a1;(void)a2;(void)a3; (void)a4;(void)a5;(void)a6;(void)a7;(void)a8;(void)a9;(void)a10;return ZwRosSystemServiceThunk(2,&a0);} -EXTERN_C void*__stdcall ZwAddAtom(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(3,&a0);} -EXTERN_C void*__stdcall ZwAddBootEntry(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(4,&a0);} -EXTERN_C void*__stdcall ZwAdjustGroupsToken(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(vo id)a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(5,&a0);} -EXTERN_C void*__stdcall ZwAdjustPrivilegesToken(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5) {(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(6,&a0);} -EXTERN_C void*__stdcall ZwAlertResumeThread(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(7,&a0);} -EXTERN_C void*__stdcall ZwAlertThread(void*a0){return ZwRosSystemServiceThunk(8,&a0);} -EXTERN_C void*__stdcall ZwAllocateLocallyUniqueId(void*a0){return ZwRosSystemServiceThunk(9,&a0);} -EXTERN_C void*__stdcall ZwAllocateUuids(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;(void )a3;return ZwRosSystemServiceThunk(10,&a0);} -EXTERN_C void*__stdcall ZwAllocateVirtualMemory(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5) {(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(11,&a0);} -EXTERN_C void*__stdcall ZwAssignProcessToJobObject(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(12,&a0);} -EXTERN_C void*__stdcall ZwCallbackReturn(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(13,&a0);} -EXTERN_C void*__stdcall ZwCancelIoFile(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(14,&a0);} -EXTERN_C void*__stdcall ZwCancelTimer(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(15,&a0);} -EXTERN_C void*__stdcall ZwClearEvent(void*a0){return ZwRosSystemServiceThunk(16,&a0);} -EXTERN_C void*__stdcall ZwClose(void*a0){return ZwRosSystemServiceThunk(17,&a0);} -EXTERN_C void*__stdcall ZwCloseObjectAuditAlarm(void*a0,void*a1,void*a2){(void)a1;(void)a2;retur n ZwRosSystemServiceThunk(18,&a0);} -EXTERN_C void*__stdcall ZwCompleteConnectPort(void*a0){return ZwRosSystemServiceThunk(19,&a0);} -EXTERN_C void*__stdcall ZwConnectPort(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6,vo id*a7){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;(void)a7;re turn ZwRosSystemServiceThunk(20,&a0);} -EXTERN_C void*__stdcall ZwContinue(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(21,&a0);} -EXTERN_C void*__stdcall ZwCreateDirectoryObject(void*a0,void*a1,void*a2){(void)a1;(void)a2;retur n ZwRosSystemServiceThunk(22,&a0);} -EXTERN_C void*__stdcall ZwCreateEvent(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void)a2 ;(void)a3;(void)a4;return ZwRosSystemServiceThunk(23,&a0);} -EXTERN_C void*__stdcall ZwCreateEventPair(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(24,&a0);} -EXTERN_C void*__stdcall ZwCreateFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6,voi d*a7,void*a8,void*a9,void*a10){(void)a1;(void)a2;(void)a3;(void)a4;(void )a5;(void)a6;(void)a7;(void)a8;(void)a9;(void)a10;return ZwRosSystemServiceThunk(25,&a0);} -EXTERN_C void*__stdcall ZwCreateIoCompletion(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2; (void)a3;return ZwRosSystemServiceThunk(26,&a0);} -EXTERN_C void*__stdcall ZwCreateJobObject(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(27,&a0);} -EXTERN_C void*__stdcall ZwCreateKey(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6){(vo id)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;return ZwRosSystemServiceThunk(28,&a0);} -EXTERN_C void*__stdcall ZwCreateMailslotFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,voi d*a6,void*a7){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;(voi d)a7;return ZwRosSystemServiceThunk(29,&a0);} -EXTERN_C void*__stdcall ZwCreateMutant(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;(void) a3;return ZwRosSystemServiceThunk(30,&a0);} -EXTERN_C void*__stdcall ZwCreateNamedPipeFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,vo id*a6,void*a7,void*a8,void*a9,void*a10,void*a11,void*a12,void*a13){(void )a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;(void)a7;(void)a8;(void )a9;(void)a10;(void)a11;(void)a12;(void)a13;return ZwRosSystemServiceThunk(31,&a0);} -EXTERN_C void*__stdcall ZwCreatePagingFile(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;(v oid)a3;return ZwRosSystemServiceThunk(32,&a0);} -EXTERN_C void*__stdcall ZwCreatePort(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void)a2; (void)a3;(void)a4;return ZwRosSystemServiceThunk(33,&a0);} -EXTERN_C void*__stdcall ZwCreateProcess(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6, void*a7){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;(void)a7; return ZwRosSystemServiceThunk(34,&a0);} -EXTERN_C void*__stdcall ZwCreateProfile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6, void*a7,void*a8){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;( void)a7;(void)a8;return ZwRosSystemServiceThunk(35,&a0);} -EXTERN_C void*__stdcall ZwCreateSection(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6) {(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;return ZwRosSystemServiceThunk(36,&a0);} -EXTERN_C void*__stdcall ZwCreateSemaphore(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(voi d)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(37,&a0);} -EXTERN_C void*__stdcall ZwCreateSymbolicLinkObject(void*a0,void*a1,void*a2,void*a3){(void)a1;(vo id)a2;(void)a3;return ZwRosSystemServiceThunk(38,&a0);} -EXTERN_C void*__stdcall ZwCreateThread(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6,v oid*a7){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;(void)a7;r eturn ZwRosSystemServiceThunk(39,&a0);} -EXTERN_C void*__stdcall ZwCreateTimer(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;(void)a 3;return ZwRosSystemServiceThunk(40,&a0);} -EXTERN_C void*__stdcall ZwCreateToken(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6,vo id*a7,void*a8,void*a9,void*a10,void*a11,void*a12){(void)a1;(void)a2;(voi d)a3;(void)a4;(void)a5;(void)a6;(void)a7;(void)a8;(void)a9;(void)a10;(vo id)a11;(void)a12;return ZwRosSystemServiceThunk(41,&a0);} -EXTERN_C void*__stdcall ZwCreateWaitablePort(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;( void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(42,&a0);} -EXTERN_C void*__stdcall ZwDelayExecution(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(43,&a0);} -EXTERN_C void*__stdcall ZwDeleteAtom(void*a0){return ZwRosSystemServiceThunk(44,&a0);} -EXTERN_C void*__stdcall ZwDeleteBootEntry(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(45,&a0);} -EXTERN_C void*__stdcall ZwDeleteFile(void*a0){return ZwRosSystemServiceThunk(46,&a0);} -EXTERN_C void*__stdcall ZwDeleteKey(void*a0){return ZwRosSystemServiceThunk(47,&a0);} -EXTERN_C void*__stdcall ZwDeleteObjectAuditAlarm(void*a0,void*a1,void*a2){(void)a1;(void)a2;retu rn ZwRosSystemServiceThunk(48,&a0);} -EXTERN_C void*__stdcall ZwDeleteValueKey(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(49,&a0);} -EXTERN_C void*__stdcall ZwDeviceIoControlFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,vo id*a6,void*a7,void*a8,void*a9){(void)a1;(void)a2;(void)a3;(void)a4;(void )a5;(void)a6;(void)a7;(void)a8;(void)a9;return ZwRosSystemServiceThunk(50,&a0);} -EXTERN_C void*__stdcall ZwDisplayString(void*a0){return ZwRosSystemServiceThunk(51,&a0);} -EXTERN_C void*__stdcall ZwDuplicateObject(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a 6){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;return ZwRosSystemServiceThunk(52,&a0);} -EXTERN_C void*__stdcall ZwDuplicateToken(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(void) a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(53,&a0);} -EXTERN_C void*__stdcall ZwEnumerateBootEntries(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(54,&a0);} -EXTERN_C void*__stdcall ZwEnumerateKey(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(void)a1 ;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(55,&a0);} -EXTERN_C void*__stdcall ZwEnumerateValueKey(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(vo id)a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(56,&a0);} -EXTERN_C void*__stdcall ZwExtendSection(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(57,&a0);} -EXTERN_C void*__stdcall ZwFindAtom(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(58,&a0);} -EXTERN_C void*__stdcall ZwFlushBuffersFile(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(59,&a0);} -EXTERN_C void*__stdcall ZwFlushInstructionCache(void*a0,void*a1,void*a2){(void)a1;(void)a2;retur n ZwRosSystemServiceThunk(60,&a0);} -EXTERN_C void*__stdcall ZwFlushKey(void*a0){return ZwRosSystemServiceThunk(61,&a0);} -EXTERN_C void*__stdcall ZwFlushVirtualMemory(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2; (void)a3;return ZwRosSystemServiceThunk(62,&a0);} -EXTERN_C void*__stdcall ZwFlushWriteBuffer(void){return ZwRosSystemServiceThunk(63,0);} -EXTERN_C void*__stdcall ZwFreeVirtualMemory(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;( void)a3;return ZwRosSystemServiceThunk(64,&a0);} -EXTERN_C void*__stdcall ZwFsControlFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6, void*a7,void*a8,void*a9){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(v oid)a6;(void)a7;(void)a8;(void)a9;return ZwRosSystemServiceThunk(65,&a0);} -EXTERN_C void*__stdcall ZwGetContextThread(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(66,&a0);} -EXTERN_C void*__stdcall ZwGetPlugPlayEvent(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;(v oid)a3;return ZwRosSystemServiceThunk(67,&a0);} -EXTERN_C void*__stdcall ZwGetTickCount(void){return ZwRosSystemServiceThunk(68,0);} -EXTERN_C void*__stdcall ZwImpersonateClientOfPort(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(69,&a0);} -EXTERN_C void*__stdcall ZwImpersonateThread(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(70,&a0);} -EXTERN_C void*__stdcall ZwInitializeRegistry(void*a0){return ZwRosSystemServiceThunk(71,&a0);} -EXTERN_C void*__stdcall ZwInitiatePowerAction(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2 ;(void)a3;return ZwRosSystemServiceThunk(72,&a0);} -EXTERN_C void*__stdcall ZwIsProcessInJob(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(73,&a0);} -EXTERN_C void*__stdcall ZwListenPort(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(74,&a0);} -EXTERN_C void*__stdcall ZwLoadDriver(void*a0){return ZwRosSystemServiceThunk(75,&a0);} -EXTERN_C void*__stdcall ZwLoadKey(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(76,&a0);} -EXTERN_C void*__stdcall ZwLoadKey2(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(77,&a0);} -EXTERN_C void*__stdcall ZwLockFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6,void* a7,void*a8,void*a9){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a 6;(void)a7;(void)a8;(void)a9;return ZwRosSystemServiceThunk(78,&a0);} -EXTERN_C void*__stdcall ZwLockVirtualMemory(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;( void)a3;return ZwRosSystemServiceThunk(79,&a0);} -EXTERN_C void*__stdcall ZwMakePermanentObject(void*a0){return ZwRosSystemServiceThunk(80,&a0);} -EXTERN_C void*__stdcall ZwMakeTemporaryObject(void*a0){return ZwRosSystemServiceThunk(81,&a0);} -EXTERN_C void*__stdcall ZwMapViewOfSection(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void* a6,void*a7,void*a8,void*a9){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5 ;(void)a6;(void)a7;(void)a8;(void)a9;return ZwRosSystemServiceThunk(82,&a0);} -EXTERN_C void*__stdcall ZwNotifyChangeDirectoryFile(void*a0,void*a1,void*a2,void*a3,void*a4,void *a5,void*a6,void*a7,void*a8){(void)a1;(void)a2;(void)a3;(void)a4;(void)a 5;(void)a6;(void)a7;(void)a8;return ZwRosSystemServiceThunk(83,&a0);} -EXTERN_C void*__stdcall ZwNotifyChangeKey(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a 6,void*a7,void*a8,void*a9){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5; (void)a6;(void)a7;(void)a8;(void)a9;return ZwRosSystemServiceThunk(84,&a0);} -EXTERN_C void*__stdcall ZwOpenDirectoryObject(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(85,&a0);} -EXTERN_C void*__stdcall ZwOpenEvent(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(86,&a0);} -EXTERN_C void*__stdcall ZwOpenEventPair(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(87,&a0);} -EXTERN_C void*__stdcall ZwOpenFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(void)a1;(vo id)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(88,&a0);} -EXTERN_C void*__stdcall ZwOpenIoCompletion(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(89,&a0);} -EXTERN_C void*__stdcall ZwOpenJobObject(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(90,&a0);} -EXTERN_C void*__stdcall ZwOpenKey(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(91,&a0);} -EXTERN_C void*__stdcall ZwOpenMutant(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(92,&a0);} -EXTERN_C void*__stdcall ZwOpenObjectAuditAlarm(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,v oid*a6,void*a7,void*a8,void*a9,void*a10,void*a11){(void)a1;(void)a2;(voi d)a3;(void)a4;(void)a5;(void)a6;(void)a7;(void)a8;(void)a9;(void)a10;(vo id)a11;return ZwRosSystemServiceThunk(93,&a0);} -EXTERN_C void*__stdcall ZwOpenProcess(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;(void)a 3;return ZwRosSystemServiceThunk(94,&a0);} -EXTERN_C void*__stdcall ZwOpenProcessToken(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(95,&a0);} -EXTERN_C void*__stdcall ZwOpenProcessTokenEx(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2; (void)a3;return ZwRosSystemServiceThunk(96,&a0);} -EXTERN_C void*__stdcall ZwOpenSection(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(97,&a0);} -EXTERN_C void*__stdcall ZwOpenSemaphore(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(98,&a0);} -EXTERN_C void*__stdcall ZwOpenSymbolicLinkObject(void*a0,void*a1,void*a2){(void)a1;(void)a2;retu rn ZwRosSystemServiceThunk(99,&a0);} -EXTERN_C void*__stdcall ZwOpenThread(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;(void)a3 ;return ZwRosSystemServiceThunk(100,&a0);} -EXTERN_C void*__stdcall ZwOpenThreadToken(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;(vo id)a3;return ZwRosSystemServiceThunk(101,&a0);} -EXTERN_C void*__stdcall ZwOpenThreadTokenEx(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(v oid)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(102,&a0);} -EXTERN_C void*__stdcall ZwOpenTimer(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(103,&a0);} -EXTERN_C void*__stdcall ZwPlugPlayControl(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;(vo id)a3;return ZwRosSystemServiceThunk(104,&a0);} -EXTERN_C void*__stdcall ZwPowerInformation(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(vo id)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(105,&a0);} -EXTERN_C void*__stdcall ZwPrivilegeCheck(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(106,&a0);} -EXTERN_C void*__stdcall ZwPrivilegedServiceAuditAlarm(void*a0,void*a1,void*a2,void*a3,void*a4){( void)a1;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(107,&a0);} -EXTERN_C void*__stdcall ZwPrivilegeObjectAuditAlarm(void*a0,void*a1,void*a2,void*a3,void*a4,void *a5){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(108,&a0);} -EXTERN_C void*__stdcall ZwProtectVirtualMemory(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1 ;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(109,&a0);} -EXTERN_C void*__stdcall ZwPulseEvent(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(110,&a0);} -EXTERN_C void*__stdcall ZwQueryInformationAtom(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1 ;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(111,&a0);} -EXTERN_C void*__stdcall ZwQueryAttributesFile(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(112,&a0);} -EXTERN_C void*__stdcall ZwQueryBootEntryOrder(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(113,&a0);} -EXTERN_C void*__stdcall ZwQueryBootOptions(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(114,&a0);} -EXTERN_C void*__stdcall ZwQueryDefaultLocale(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(115,&a0);} -EXTERN_C void*__stdcall ZwQueryDefaultUILanguage(void*a0){return ZwRosSystemServiceThunk(116,&a0);} -EXTERN_C void*__stdcall ZwQueryDirectoryFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,voi d*a6,void*a7,void*a8,void*a9,void*a10){(void)a1;(void)a2;(void)a3;(void) a4;(void)a5;(void)a6;(void)a7;(void)a8;(void)a9;(void)a10;return ZwRosSystemServiceThunk(117,&a0);} -EXTERN_C void*__stdcall ZwQueryDirectoryObject(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,v oid*a6){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;return ZwRosSystemServiceThunk(118,&a0);} -EXTERN_C void*__stdcall ZwQueryEaFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6,vo id*a7,void*a8){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;(vo id)a7;(void)a8;return ZwRosSystemServiceThunk(119,&a0);} -EXTERN_C void*__stdcall ZwQueryEvent(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void)a2; (void)a3;(void)a4;return ZwRosSystemServiceThunk(120,&a0);} -EXTERN_C void*__stdcall ZwQueryFullAttributesFile(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(121,&a0);} -EXTERN_C void*__stdcall ZwQueryInformationFile(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1 ;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(122,&a0);} -EXTERN_C void*__stdcall ZwQueryInformationJobObject(void*a0,void*a1,void*a2,void*a3,void*a4){(vo id)a1;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(123,&a0);} -EXTERN_C void*__stdcall ZwQueryInformationPort(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1 ;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(124,&a0);} -EXTERN_C void*__stdcall ZwQueryInformationProcess(void*a0,void*a1,void*a2,void*a3,void*a4){(void )a1;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(125,&a0);} -EXTERN_C void*__stdcall ZwQueryInformationThread(void*a0,void*a1,void*a2,void*a3,void*a4){(void) a1;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(126,&a0);} -EXTERN_C void*__stdcall ZwQueryInformationToken(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a 1;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(127,&a0);} -EXTERN_C void*__stdcall ZwQueryInstallUILanguage(void*a0){return ZwRosSystemServiceThunk(128,&a0);} -EXTERN_C void*__stdcall ZwQueryIntervalProfile(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(129,&a0);} -EXTERN_C void*__stdcall ZwQueryIoCompletion(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(v oid)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(130,&a0);} -EXTERN_C void*__stdcall ZwQueryKey(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void)a2;(v oid)a3;(void)a4;return ZwRosSystemServiceThunk(131,&a0);} -EXTERN_C void*__stdcall ZwQueryMultipleValueKey(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5) {(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(132,&a0);} -EXTERN_C void*__stdcall ZwQueryMutant(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void)a2 ;(void)a3;(void)a4;return ZwRosSystemServiceThunk(133,&a0);} -EXTERN_C void*__stdcall ZwQueryObject(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void)a2 ;(void)a3;(void)a4;return ZwRosSystemServiceThunk(134,&a0);} -EXTERN_C void*__stdcall ZwQueryOleDirectoryFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5, void*a6,void*a7,void*a8,void*a9,void*a10){(void)a1;(void)a2;(void)a3;(vo id)a4;(void)a5;(void)a6;(void)a7;(void)a8;(void)a9;(void)a10;return ZwRosSystemServiceThunk(135,&a0);} -EXTERN_C void*__stdcall ZwQueryPerformanceCounter(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(136,&a0);} -EXTERN_C void*__stdcall ZwQueryQuotaInformationFile(void*a0,void*a1,void*a2,void*a3,void*a4,void *a5,void*a6,void*a7,void*a8){(void)a1;(void)a2;(void)a3;(void)a4;(void)a 5;(void)a6;(void)a7;(void)a8;return ZwRosSystemServiceThunk(137,&a0);} -EXTERN_C void*__stdcall ZwQuerySection(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void)a 2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(138,&a0);} -EXTERN_C void*__stdcall ZwQuerySecurityObject(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1; (void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(139,&a0);} -EXTERN_C void*__stdcall ZwQuerySemaphore(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void )a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(140,&a0);} -EXTERN_C void*__stdcall ZwQuerySymbolicLinkObject(void*a0,void*a1,void*a2){(void)a1;(void)a2;ret urn ZwRosSystemServiceThunk(141,&a0);} -EXTERN_C void*__stdcall ZwQuerySystemEnvironmentValue(void*a0,void*a1,void*a2,void*a3){(void)a1; (void)a2;(void)a3;return ZwRosSystemServiceThunk(142,&a0);} -EXTERN_C void*__stdcall ZwQuerySystemInformation(void*a0,void*a1,void*a2,void*a3){(void)a1;(void )a2;(void)a3;return ZwRosSystemServiceThunk(143,&a0);} -EXTERN_C void*__stdcall ZwQuerySystemTime(void*a0){return ZwRosSystemServiceThunk(144,&a0);} -EXTERN_C void*__stdcall ZwQueryTimer(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void)a2; (void)a3;(void)a4;return ZwRosSystemServiceThunk(145,&a0);} -EXTERN_C void*__stdcall ZwQueryTimerResolution(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(146,&a0);} -EXTERN_C void*__stdcall ZwQueryValueKey(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(void)a 1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(147,&a0);} -EXTERN_C void*__stdcall ZwQueryVirtualMemory(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(v oid)a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(148,&a0);} -EXTERN_C void*__stdcall ZwQueryVolumeInformationFile(void*a0,void*a1,void*a2,void*a3,void*a4){(v oid)a1;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(149,&a0);} -EXTERN_C void*__stdcall ZwQueueApcThread(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void )a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(150,&a0);} -EXTERN_C void*__stdcall ZwRaiseException(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(151,&a0);} -EXTERN_C void*__stdcall ZwRaiseHardError(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(void) a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(152,&a0);} -EXTERN_C void*__stdcall ZwReadFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6,void* a7,void*a8){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;(void) a7;(void)a8;return ZwRosSystemServiceThunk(153,&a0);} -EXTERN_C void*__stdcall ZwReadFileScatter(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a 6,void*a7,void*a8){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6 ;(void)a7;(void)a8;return ZwRosSystemServiceThunk(154,&a0);} -EXTERN_C void*__stdcall ZwReadRequestData(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(void )a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(155,&a0);} -EXTERN_C void*__stdcall ZwReadVirtualMemory(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(v oid)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(156,&a0);} -EXTERN_C void*__stdcall ZwRegisterThreadTerminatePort(void*a0){return ZwRosSystemServiceThunk(157,&a0);} -EXTERN_C void*__stdcall ZwReleaseMutant(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(158,&a0);} -EXTERN_C void*__stdcall ZwReleaseSemaphore(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(159,&a0);} -EXTERN_C void*__stdcall ZwRemoveIoCompletion(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;( void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(160,&a0);} -EXTERN_C void*__stdcall ZwReplaceKey(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(161,&a0);} -EXTERN_C void*__stdcall ZwReplyPort(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(162,&a0);} -EXTERN_C void*__stdcall ZwReplyWaitReceivePort(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a 2;(void)a3;return ZwRosSystemServiceThunk(163,&a0);} -EXTERN_C void*__stdcall ZwReplyWaitReplyPort(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(164,&a0);} -EXTERN_C void*__stdcall ZwRequestPort(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(165,&a0);} -EXTERN_C void*__stdcall ZwRequestWaitReplyPort(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(166,&a0);} -EXTERN_C void*__stdcall ZwResetEvent(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(167,&a0);} -EXTERN_C void*__stdcall ZwRestoreKey(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(168,&a0);} -EXTERN_C void*__stdcall ZwResumeThread(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(169,&a0);} -EXTERN_C void*__stdcall ZwSaveKey(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(170,&a0);} -EXTERN_C void*__stdcall ZwSaveKeyEx(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(171,&a0);} -EXTERN_C void*__stdcall ZwSetBootEntryOrder(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(172,&a0);} -EXTERN_C void*__stdcall ZwSetBootOptions(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(173,&a0);} -EXTERN_C void*__stdcall ZwSetIoCompletion(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(voi d)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(174,&a0);} -EXTERN_C void*__stdcall ZwSetContextThread(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(175,&a0);} -EXTERN_C void*__stdcall ZwSetDefaultHardErrorPort(void*a0){return ZwRosSystemServiceThunk(176,&a0);} -EXTERN_C void*__stdcall ZwSetDefaultLocale(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(177,&a0);} -EXTERN_C void*__stdcall ZwSetDefaultUILanguage(void*a0){return ZwRosSystemServiceThunk(178,&a0);} -EXTERN_C void*__stdcall ZwSetEaFile(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;(void)a3; return ZwRosSystemServiceThunk(179,&a0);} -EXTERN_C void*__stdcall ZwSetEvent(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(180,&a0);} -EXTERN_C void*__stdcall ZwSetHighEventPair(void*a0){return ZwRosSystemServiceThunk(181,&a0);} -EXTERN_C void*__stdcall ZwSetHighWaitLowEventPair(void*a0){return ZwRosSystemServiceThunk(182,&a0);} -EXTERN_C void*__stdcall ZwSetHighWaitLowThread(void){return ZwRosSystemServiceThunk(183,0);} -EXTERN_C void*__stdcall ZwSetInformationFile(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;( void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(184,&a0);} -EXTERN_C void*__stdcall ZwSetInformationKey(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;( void)a3;return ZwRosSystemServiceThunk(185,&a0);} -EXTERN_C void*__stdcall ZwSetInformationJobObject(void*a0,void*a1,void*a2,void*a3){(void)a1;(voi d)a2;(void)a3;return ZwRosSystemServiceThunk(186,&a0);} -EXTERN_C void*__stdcall ZwSetInformationObject(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a 2;(void)a3;return ZwRosSystemServiceThunk(187,&a0);} -EXTERN_C void*__stdcall ZwSetInformationProcess(void*a0,void*a1,void*a2,void*a3){(void)a1;(void) a2;(void)a3;return ZwRosSystemServiceThunk(188,&a0);} -EXTERN_C void*__stdcall ZwSetInformationThread(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a 2;(void)a3;return ZwRosSystemServiceThunk(189,&a0);} -EXTERN_C void*__stdcall ZwSetInformationToken(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2 ;(void)a3;return ZwRosSystemServiceThunk(190,&a0);} -EXTERN_C void*__stdcall ZwSetIntervalProfile(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(191,&a0);} -EXTERN_C void*__stdcall ZwSetLdtEntries(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(void)a 1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(192,&a0);} -EXTERN_C void*__stdcall ZwSetLowEventPair(void*a0){return ZwRosSystemServiceThunk(193,&a0);} -EXTERN_C void*__stdcall ZwSetLowWaitHighEventPair(void*a0){return ZwRosSystemServiceThunk(194,&a0);} -EXTERN_C void*__stdcall ZwSetLowWaitHighThread(void){return ZwRosSystemServiceThunk(195,0);} -EXTERN_C void*__stdcall ZwSetQuotaInformationFile(void*a0,void*a1,void*a2,void*a3){(void)a1;(voi d)a2;(void)a3;return ZwRosSystemServiceThunk(196,&a0);} -EXTERN_C void*__stdcall ZwSetSecurityObject(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(197,&a0);} -EXTERN_C void*__stdcall ZwSetSystemEnvironmentValue(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(198,&a0);} -EXTERN_C void*__stdcall ZwSetSystemInformation(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(199,&a0);} -EXTERN_C void*__stdcall ZwSetSystemPowerState(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(200,&a0);} -EXTERN_C void*__stdcall ZwSetSystemTime(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(201,&a0);} -EXTERN_C void*__stdcall ZwSetTimer(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6){(voi d)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;return ZwRosSystemServiceThunk(202,&a0);} -EXTERN_C void*__stdcall ZwSetTimerResolution(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(203,&a0);} -EXTERN_C void*__stdcall ZwSetUuidSeed(void*a0){return ZwRosSystemServiceThunk(204,&a0);} -EXTERN_C void*__stdcall ZwSetValueKey(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(void)a1; (void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(205,&a0);} -EXTERN_C void*__stdcall ZwSetVolumeInformationFile(void*a0,void*a1,void*a2,void*a3,void*a4){(voi d)a1;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(206,&a0);} -EXTERN_C void*__stdcall ZwShutdownSystem(void*a0){return ZwRosSystemServiceThunk(207,&a0);} -EXTERN_C void*__stdcall ZwSignalAndWaitForSingleObject(void*a0,void*a1,void*a2,void*a3){(void)a1 ;(void)a2;(void)a3;return ZwRosSystemServiceThunk(208,&a0);} -EXTERN_C void*__stdcall ZwStartProfile(void*a0){return ZwRosSystemServiceThunk(209,&a0);} -EXTERN_C void*__stdcall ZwStopProfile(void*a0){return ZwRosSystemServiceThunk(210,&a0);} -EXTERN_C void*__stdcall ZwSuspendThread(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(211,&a0);} -EXTERN_C void*__stdcall ZwSystemDebugControl(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(v oid)a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(212,&a0);} -EXTERN_C void*__stdcall ZwTerminateJobObject(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(213,&a0);} -EXTERN_C void*__stdcall ZwTerminateProcess(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(214,&a0);} -EXTERN_C void*__stdcall ZwTerminateThread(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(215,&a0);} -EXTERN_C void*__stdcall ZwTestAlert(void){return ZwRosSystemServiceThunk(216,0);} -EXTERN_C void*__stdcall ZwTraceEvent(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2;(void)a3 ;return ZwRosSystemServiceThunk(217,&a0);} -EXTERN_C void*__stdcall ZwTranslateFilePath(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(218,&a0);} -EXTERN_C void*__stdcall ZwUnloadDriver(void*a0){return ZwRosSystemServiceThunk(219,&a0);} -EXTERN_C void*__stdcall ZwUnloadKey(void*a0){return ZwRosSystemServiceThunk(220,&a0);} -EXTERN_C void*__stdcall ZwUnlockFile(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void)a2; (void)a3;(void)a4;return ZwRosSystemServiceThunk(221,&a0);} -EXTERN_C void*__stdcall ZwUnlockVirtualMemory(void*a0,void*a1,void*a2,void*a3){(void)a1;(void)a2 ;(void)a3;return ZwRosSystemServiceThunk(222,&a0);} -EXTERN_C void*__stdcall ZwUnmapViewOfSection(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(223,&a0);} -EXTERN_C void*__stdcall ZwVdmControl(void*a0,void*a1){(void)a1;return ZwRosSystemServiceThunk(224,&a0);} -EXTERN_C void*__stdcall ZwWaitForMultipleObjects(void*a0,void*a1,void*a2,void*a3,void*a4){(void) a1;(void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(225,&a0);} -EXTERN_C void*__stdcall ZwWaitForSingleObject(void*a0,void*a1,void*a2){(void)a1;(void)a2;return ZwRosSystemServiceThunk(226,&a0);} -EXTERN_C void*__stdcall ZwWaitHighEventPair(void*a0){return ZwRosSystemServiceThunk(227,&a0);} -EXTERN_C void*__stdcall ZwWaitLowEventPair(void*a0){return ZwRosSystemServiceThunk(228,&a0);} -EXTERN_C void*__stdcall ZwWriteFile(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a6,void *a7,void*a8){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6;(void )a7;(void)a8;return ZwRosSystemServiceThunk(229,&a0);} -EXTERN_C void*__stdcall ZwWriteFileGather(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5,void*a 6,void*a7,void*a8){(void)a1;(void)a2;(void)a3;(void)a4;(void)a5;(void)a6 ;(void)a7;(void)a8;return ZwRosSystemServiceThunk(230,&a0);} -EXTERN_C void*__stdcall ZwWriteRequestData(void*a0,void*a1,void*a2,void*a3,void*a4,void*a5){(voi d)a1;(void)a2;(void)a3;(void)a4;(void)a5;return ZwRosSystemServiceThunk(231,&a0);} -EXTERN_C void*__stdcall ZwWriteVirtualMemory(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;( void)a2;(void)a3;(void)a4;return ZwRosSystemServiceThunk(232,&a0);} -EXTERN_C void*__stdcall ZwW32Call(void*a0,void*a1,void*a2,void*a3,void*a4){(void)a1;(void)a2;(vo id)a3;(void)a4;return ZwRosSystemServiceThunk(233,&a0);} -EXTERN_C void*__stdcall ZwYieldExecution(void){return ZwRosSystemServiceThunk(234,0);}
19 years, 11 months
1
0
0
0
[ion] 12861: Remove /nt directory
by ion@svn.reactos.com
Remove /nt directory Modified: trunk/reactos/iface/native/makefile Modified: trunk/reactos/iface/native/sysfuncs.lst Modified: trunk/reactos/include/ddk/ketypes.h Modified: trunk/reactos/lib/ntdll/def/ntdll.def Modified: trunk/reactos/ntoskrnl/Makefile Modified: trunk/reactos/ntoskrnl/Makefile.i386 Added: trunk/reactos/ntoskrnl/ex/event.c Added: trunk/reactos/ntoskrnl/ex/evtpair.c Modified: trunk/reactos/ntoskrnl/ex/init.c Added: trunk/reactos/ntoskrnl/ex/mutant.c Added: trunk/reactos/ntoskrnl/ex/profile.c Added: trunk/reactos/ntoskrnl/ex/sem.c Added: trunk/reactos/ntoskrnl/ex/timer.c Modified: trunk/reactos/ntoskrnl/inbv/inbv.c Modified: trunk/reactos/ntoskrnl/include/internal/ke.h Modified: trunk/reactos/ntoskrnl/include/internal/ntoskrnl.h Modified: trunk/reactos/ntoskrnl/include/internal/port.h Modified: trunk/reactos/ntoskrnl/include/ntoskrnl.h Added: trunk/reactos/ntoskrnl/io/efi.c Added: trunk/reactos/ntoskrnl/io/plugplay.c Added: trunk/reactos/ntoskrnl/ke/i386/vdm.c Modified: trunk/reactos/ntoskrnl/ke/main.c Modified: trunk/reactos/ntoskrnl/ke/profile.c Added: trunk/reactos/ntoskrnl/ke/zw.c Modified: trunk/reactos/ntoskrnl/lpc/connect.c Modified: trunk/reactos/ntoskrnl/lpc/create.c Modified: trunk/reactos/ntoskrnl/lpc/port.c _____ Modified: trunk/reactos/iface/native/makefile --- trunk/reactos/iface/native/makefile 2005-01-07 01:03:34 UTC (rev 12860) +++ trunk/reactos/iface/native/makefile 2005-01-07 06:54:27 UTC (rev 12861) @@ -14,7 +14,7 @@ SYSTEM_CALLS_DB = sysfuncs.lst NTDLL_STUBS = ../../lib/ntdll/napi.c KERNEL_SERVICE_TABLE = ../../include/ntdll/napi.h -KERNEL_ZW_CALLS = ../../ntoskrnl/nt/zw.c +KERNEL_ZW_CALLS = ../../ntoskrnl/ke/zw.c NAPI_FILES = $(NTDLL_STUBS) $(KERNEL_SERVICE_TABLE) $(KERNEL_ZW_CALLS) BASE_CFLAGS = -I../../include _____ Modified: trunk/reactos/iface/native/sysfuncs.lst --- trunk/reactos/iface/native/sysfuncs.lst 2005-01-07 01:03:34 UTC (rev 12860) +++ trunk/reactos/iface/native/sysfuncs.lst 2005-01-07 06:54:27 UTC (rev 12861) @@ -232,10 +232,4 @@ NtWriteRequestData ZwWriteRequestData 6 NtWriteVirtualMemory ZwWriteVirtualMemory 5 NtW32Call ZwW32Call 5 -NtCreateChannel ZwCreateChannel 2 -NtListenChannel ZwListenChannel 2 -NtOpenChannel ZwOpenChannel 2 -NtReplyWaitSendChannel ZwReplyWaitSendChannel 3 -NtSendWaitReplyChannel ZwSendWaitReplyChannel 4 -NtSetContextChannel ZwSetContextChannel 1 NtYieldExecution ZwYieldExecution 0 _____ Modified: trunk/reactos/include/ddk/ketypes.h --- trunk/reactos/include/ddk/ketypes.h 2005-01-07 01:03:34 UTC (rev 12860) +++ trunk/reactos/include/ddk/ketypes.h 2005-01-07 06:54:27 UTC (rev 12861) @@ -99,6 +99,10 @@ BOOLEAN Busy; } KDEVICE_QUEUE, *PKDEVICE_QUEUE; +/* + * Size of the profile hash table. + */ +#define PROFILE_HASH_TABLE_SIZE (32) #include <pshpack2.h> _____ Modified: trunk/reactos/lib/ntdll/def/ntdll.def --- trunk/reactos/lib/ntdll/def/ntdll.def 2005-01-07 01:03:34 UTC (rev 12860) +++ trunk/reactos/lib/ntdll/def/ntdll.def 2005-01-07 06:54:27 UTC (rev 12861) @@ -77,7 +77,6 @@ NtCompleteConnectPort@4 NtConnectPort@32 NtContinue@8 -NtCreateChannel@8 NtCreateDirectoryObject@12 NtCreateEvent@20 NtCreateEventPair@12 @@ -128,7 +127,6 @@ NtImpersonateThread@12 NtInitializeRegistry@4 NtIsProcessInJob@8 -NtListenChannel@8 NtListenPort@8 NtLoadDriver@4 NtLoadKey@8 @@ -139,7 +137,6 @@ NtMapViewOfSection@40 NtNotifyChangeDirectoryFile@36 NtNotifyChangeKey@40 -NtOpenChannel@8 NtOpenDirectoryObject@12 NtOpenEvent@12 NtOpenEventPair@12 @@ -212,17 +209,14 @@ NtRemoveIoCompletion@20 NtReplaceKey@12 NtReplyPort@8 -NtReplyWaitReceivePort@16 NtReplyWaitReplyPort@8 -NtReplyWaitSendChannel@12 +NtReplyWaitReceivePort@16 NtRequestPort@8 NtRequestWaitReplyPort@12 NtResetEvent@8 NtRestoreKey@12 NtResumeThread@8 NtSaveKey@8 -NtSendWaitReplyChannel@16 -NtSetContextChannel@4 NtSetContextThread@8 NtSetDefaultHardErrorPort@4 NtSetDefaultLocale@8 @@ -704,7 +698,6 @@ ZwCompleteConnectPort@4 ZwConnectPort@32 ZwContinue@8 -ZwCreateChannel@8 ZwCreateDirectoryObject@12 ZwCreateEvent@20 ZwCreateEventPair@12 @@ -751,7 +744,6 @@ ZwImpersonateClientOfPort@8 ZwImpersonateThread@12 ZwInitializeRegistry@4 -ZwListenChannel@8 ZwListenPort@8 ZwLoadDriver@4 ZwLoadKey@8 @@ -762,7 +754,6 @@ ZwMapViewOfSection@40 ZwNotifyChangeDirectoryFile@36 ZwNotifyChangeKey@40 -ZwOpenChannel@8 ZwOpenDirectoryObject@12 ZwOpenEvent@12 ZwOpenEventPair@12 @@ -835,15 +826,12 @@ ZwReplyPort@8 ZwReplyWaitReceivePort@16 ZwReplyWaitReplyPort@8 -ZwReplyWaitSendChannel@12 ZwRequestPort@8 ZwRequestWaitReplyPort@12 ZwResetEvent@8 ZwRestoreKey@12 ZwResumeThread@8 ZwSaveKey@8 -ZwSendWaitReplyChannel@16 -ZwSetContextChannel@4 ZwSetContextThread@8 ZwSetDefaultHardErrorPort@4 ZwSetDefaultLocale@8 _____ Modified: trunk/reactos/ntoskrnl/Makefile --- trunk/reactos/ntoskrnl/Makefile 2005-01-07 01:03:34 UTC (rev 12860) +++ trunk/reactos/ntoskrnl/Makefile 2005-01-07 06:54:27 UTC (rev 12861) @@ -77,22 +77,6 @@ # include Makefile.$(ARCH) -# System API (Nt/Zw) -OBJECTS_NT = \ - nt/channel.o \ - nt/efi.o \ - nt/evtpair.o \ - nt/mutant.o \ - nt/misc.o \ - nt/nt.o \ - nt/ntevent.o \ - nt/ntsem.o \ - nt/nttimer.o \ - nt/plugplay.o \ - nt/profile.o \ - nt/vdm.o \ - nt/zw.o - # Run-Time Library (Rtl) OBJECTS_RTL = \ rtl/atom.o \ @@ -136,7 +120,8 @@ ke/sem.o \ ke/spinlock.o \ ke/timer.o \ - ke/wait.o + ke/wait.o \ + ke/zw.o # Memory Manager (Mm) OBJECTS_MM = \ @@ -188,6 +173,7 @@ io/deviface.o \ io/dir.o \ io/driver.o \ + io/efi.o \ io/errlog.o \ io/error.o \ io/event.o \ @@ -206,6 +192,7 @@ io/npipe.o \ io/page.o \ io/parttab.o \ + io/plugplay.o \ io/process.o \ io/pnpnotify.o \ io/pnpdma.o \ @@ -259,20 +246,26 @@ OBJECTS_EX = \ ex/btree.o \ ex/callback.o \ + ex/event.o \ + ex/evtpair.o \ ex/fmutex.o \ ex/hashtab.o \ ex/init.o \ ex/interlck.o \ ex/list.o \ ex/lookas.o \ + ex/mutant.o \ ex/napi.o \ ex/power.o \ + ex/profile.o \ ex/resource.o \ ex/rundown.o \ ex/stree.o \ + ex/sem.o \ ex/synch.o \ ex/sysinfo.o \ ex/time.o \ + ex/timer.o \ ex/util.o \ ex/uuid.o \ ex/win32k.o \ @@ -371,7 +364,7 @@ OBJECTS_INBV = \ inbv/inbv.o -DEP_OBJECTS := $(OBJECTS_NT) $(OBJECTS_MM) $(OBJECTS_ARCH) \ +DEP_OBJECTS := $(OBJECTS_MM) $(OBJECTS_ARCH) \ $(OBJECTS_IO) $(OBJECTS_KE) $(OBJECTS_OB) \ $(OBJECTS_PS) $(OBJECTS_EX) $(OBJECTS_CC) $(OBJECTS_FS) $(OBJECTS_SE) \ $(OBJECTS_DBG) $(OBJECTS_CM) $(OBJECTS_LDR) $(OBJECTS_LPC) \ @@ -475,12 +468,6 @@ -o $(OBJECTS_PATH)/lpc.o \ $(OBJECTS_LPC) -$(OBJECTS_PATH)/nt.o: $(OBJECTS_NT) - $(LD) \ - -r \ - -o $(OBJECTS_PATH)/nt.o \ - $(OBJECTS_NT) - $(OBJECTS_PATH)/po.o: $(OBJECTS_PO) $(LD) \ -r \ @@ -519,7 +506,6 @@ $(OBJECTS_PATH)/kd.o \ $(OBJECTS_PATH)/ldr.o \ $(OBJECTS_PATH)/mm.o \ - $(OBJECTS_PATH)/nt.o \ $(OBJECTS_PATH)/ob.o \ $(OBJECTS_PATH)/po.o \ $(OBJECTS_PATH)/ps.o \ _____ Modified: trunk/reactos/ntoskrnl/Makefile.i386 --- trunk/reactos/ntoskrnl/Makefile.i386 2005-01-07 01:03:34 UTC (rev 12860) +++ trunk/reactos/ntoskrnl/Makefile.i386 2005-01-07 06:54:27 UTC (rev 12861) @@ -22,6 +22,7 @@ ke/i386/tskswitch.o \ ke/i386/v86m.o \ ke/i386/v86m_sup.o \ + ke/i386/vdm.o \ ke/i386/bios.o \ ke/i386/i386-mcount.o \ ke/i386/gdt.o \ _____ Added: trunk/reactos/ntoskrnl/ex/event.c --- trunk/reactos/ntoskrnl/ex/event.c 2005-01-07 01:03:34 UTC (rev 12860) +++ trunk/reactos/ntoskrnl/ex/event.c 2005-01-07 06:54:27 UTC (rev 12861) @@ -0,0 +1,370 @@ +/* + * ReactOS kernel + * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/nt/event.c + * PURPOSE: Named event support + * PROGRAMMER: Philip Susi and David Welch + * UPDATE HISTORY: + * Created 22/05/98 + */ + +/* INCLUDES *****************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <internal/debug.h> + +/* GLOBALS *******************************************************************/ + +POBJECT_TYPE EXPORTED ExEventObjectType = NULL; + +static GENERIC_MAPPING ExpEventMapping = { + STANDARD_RIGHTS_READ | SYNCHRONIZE | EVENT_QUERY_STATE, + STANDARD_RIGHTS_WRITE | SYNCHRONIZE | EVENT_MODIFY_STATE, + STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE | EVENT_QUERY_STATE, + EVENT_ALL_ACCESS}; + + +/* FUNCTIONS *****************************************************************/ + +NTSTATUS STDCALL +NtpCreateEvent(PVOID ObjectBody, + PVOID Parent, + PWSTR RemainingPath, + POBJECT_ATTRIBUTES ObjectAttributes) +{ + DPRINT("NtpCreateEvent(ObjectBody %x, Parent %x, RemainingPath %S)\n", + ObjectBody, Parent, RemainingPath); + + if (RemainingPath != NULL && wcschr(RemainingPath+1, '\\') != NULL) + { + return(STATUS_UNSUCCESSFUL); + } + + return(STATUS_SUCCESS); +} + + +VOID INIT_FUNCTION +ExpInitializeEventImplementation(VOID) +{ + ExEventObjectType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE)); + + RtlCreateUnicodeString(&ExEventObjectType->TypeName, L"Event"); + + ExEventObjectType->Tag = TAG('E', 'V', 'T', 'T'); + ExEventObjectType->PeakObjects = 0; + ExEventObjectType->PeakHandles = 0; + ExEventObjectType->TotalObjects = 0; + ExEventObjectType->TotalHandles = 0; + ExEventObjectType->PagedPoolCharge = 0; + ExEventObjectType->NonpagedPoolCharge = sizeof(KEVENT); + ExEventObjectType->Mapping = &ExpEventMapping; + ExEventObjectType->Dump = NULL; + ExEventObjectType->Open = NULL; + ExEventObjectType->Close = NULL; + ExEventObjectType->Delete = NULL; + ExEventObjectType->Parse = NULL; + ExEventObjectType->Security = NULL; + ExEventObjectType->QueryName = NULL; + ExEventObjectType->OkayToClose = NULL; + ExEventObjectType->Create = NtpCreateEvent; + ExEventObjectType->DuplicationNotify = NULL; + + ObpCreateTypeObject(ExEventObjectType); +} + + +NTSTATUS STDCALL +NtClearEvent(IN HANDLE EventHandle) +{ + PKEVENT Event; + NTSTATUS Status; + + Status = ObReferenceObjectByHandle(EventHandle, + EVENT_MODIFY_STATE, + ExEventObjectType, + UserMode, + (PVOID*)&Event, + NULL); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + KeClearEvent(Event); + ObDereferenceObject(Event); + return(STATUS_SUCCESS); +} + + +/* + * @implemented + */ +NTSTATUS STDCALL +NtCreateEvent(OUT PHANDLE EventHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, + IN EVENT_TYPE EventType, + IN BOOLEAN InitialState) +{ + PKEVENT Event; + HANDLE hEvent; + NTSTATUS Status; + OBJECT_ATTRIBUTES SafeObjectAttributes; + + if (ObjectAttributes != NULL) + { + Status = MmCopyFromCaller(&SafeObjectAttributes, ObjectAttributes, + sizeof(OBJECT_ATTRIBUTES)); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + ObjectAttributes = &SafeObjectAttributes; + } + + Status = ObCreateObject(ExGetPreviousMode(), + ExEventObjectType, + ObjectAttributes, + ExGetPreviousMode(), + NULL, + sizeof(KEVENT), + 0, + 0, + (PVOID*)&Event); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + KeInitializeEvent(Event, + EventType, + InitialState); + + Status = ObInsertObject ((PVOID)Event, + NULL, + DesiredAccess, + 0, + NULL, + &hEvent); + ObDereferenceObject(Event); + if (!NT_SUCCESS(Status)) + { + return Status; + } + + Status = MmCopyToCaller(EventHandle, &hEvent, sizeof(HANDLE)); + if (!NT_SUCCESS(Status)) + { + ZwClose(hEvent); + return(Status); + } + return(STATUS_SUCCESS); +} + + +NTSTATUS STDCALL +NtOpenEvent(OUT PHANDLE EventHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes) +{ + NTSTATUS Status; + HANDLE hEvent; + + DPRINT("ObjectName '%wZ'\n", ObjectAttributes->ObjectName); + + Status = ObOpenObjectByName(ObjectAttributes, + ExEventObjectType, + NULL, + UserMode, + DesiredAccess, + NULL, + &hEvent); + + if (!NT_SUCCESS(Status)) + { + return(Status); + } + + Status = MmCopyToCaller(EventHandle, &hEvent, sizeof(HANDLE)); + if (!NT_SUCCESS(Status)) + { + ZwClose(EventHandle); + return(Status); + } + + return(Status); +} + + +NTSTATUS STDCALL +NtPulseEvent(IN HANDLE EventHandle, + OUT PLONG PreviousState OPTIONAL) +{ + PKEVENT Event; + NTSTATUS Status; + + DPRINT("NtPulseEvent(EventHandle %x PreviousState %x)\n", + EventHandle, PreviousState); + + Status = ObReferenceObjectByHandle(EventHandle, + EVENT_MODIFY_STATE, + ExEventObjectType, + UserMode, + (PVOID*)&Event, + NULL); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + + KePulseEvent(Event, EVENT_INCREMENT, FALSE); + + ObDereferenceObject(Event); + return(STATUS_SUCCESS); +} + + +NTSTATUS STDCALL +NtQueryEvent(IN HANDLE EventHandle, + IN EVENT_INFORMATION_CLASS EventInformationClass, + OUT PVOID EventInformation, + IN ULONG EventInformationLength, + OUT PULONG ReturnLength OPTIONAL) +{ + EVENT_BASIC_INFORMATION Info; + PKEVENT Event; + NTSTATUS Status; + ULONG RetLen; + + if (EventInformationClass > EventBasicInformation) + return STATUS_INVALID_INFO_CLASS; + + if (EventInformationLength < sizeof(EVENT_BASIC_INFORMATION)) + return STATUS_INFO_LENGTH_MISMATCH; + + Status = ObReferenceObjectByHandle(EventHandle, + EVENT_QUERY_STATE, + ExEventObjectType, + UserMode, + (PVOID*)&Event, + NULL); + if (!NT_SUCCESS(Status)) + return Status; + + if (Event->Header.Type == InternalNotificationEvent) + Info.EventType = NotificationEvent; + else + Info.EventType = SynchronizationEvent; + Info.EventState = KeReadStateEvent(Event); + + Status = MmCopyToCaller(EventInformation, &Event, + sizeof(EVENT_BASIC_INFORMATION)); + if (!NT_SUCCESS(Status)) + { + ObDereferenceObject(Event); + return(Status); + } + + if (ReturnLength != NULL) + { + RetLen = sizeof(EVENT_BASIC_INFORMATION); + Status = MmCopyToCaller(ReturnLength, &RetLen, sizeof(ULONG)); + if (!NT_SUCCESS(Status)) + { + ObDereferenceObject(Event); + return(Status); + } + } + + ObDereferenceObject(Event); + return(STATUS_SUCCESS); +} + + +NTSTATUS STDCALL +NtResetEvent(IN HANDLE EventHandle, + OUT PLONG PreviousState OPTIONAL) +{ + PKEVENT Event; + NTSTATUS Status; + + DPRINT("NtResetEvent(EventHandle %x)\n", EventHandle); + + Status = ObReferenceObjectByHandle(EventHandle, + EVENT_MODIFY_STATE, + ExEventObjectType, + UserMode, + (PVOID*)&Event, + NULL); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + KeResetEvent(Event); + ObDereferenceObject(Event); + return(STATUS_SUCCESS); +} + + +/* + * @implemented + */ +NTSTATUS STDCALL +NtSetEvent(IN HANDLE EventHandle, + OUT PLONG PreviousState OPTIONAL) +{ + PKEVENT Event; + NTSTATUS Status; + + DPRINT("NtSetEvent(EventHandle %x)\n", EventHandle); + + Status = ObReferenceObjectByHandle(EventHandle, + EVENT_MODIFY_STATE, + ExEventObjectType, + UserMode, + (PVOID*)&Event, + NULL); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + KeSetEvent(Event,EVENT_INCREMENT,FALSE); + ObDereferenceObject(Event); + return(STATUS_SUCCESS); +} + +/* + * @unimplemented + */ +NTSTATUS +STDCALL +NtTraceEvent( + IN ULONG TraceHandle, + IN ULONG Flags, + IN ULONG TraceHeaderLength, + IN struct _EVENT_TRACE_HEADER* TraceHeader + ) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + + +/* EOF */ _____ Added: trunk/reactos/ntoskrnl/ex/evtpair.c --- trunk/reactos/ntoskrnl/ex/evtpair.c 2005-01-07 01:03:34 UTC (rev 12860) +++ trunk/reactos/ntoskrnl/ex/evtpair.c 2005-01-07 06:54:27 UTC (rev 12861) @@ -0,0 +1,496 @@ +/* $Id: evtpair.c 12779 2005-01-04 04:45:00Z gdalsnes $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/ex/evtpair.c + * PURPOSE: Support for event pairs + * PROGRAMMER: David Welch (welch(a)mcmail.com) + * UPDATE HISTORY: + * Created 22/05/98 + * Updated 09/08/2003 by Skywing (skywing(a)valhallalegends.com) + * to correctly maintain ownership of the dispatcher lock + * between KeSetEvent and KeWaitForSingleObject calls. + * Additionally, implemented the thread-eventpair routines. + */ + +/* INCLUDES *****************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <internal/debug.h> + +#ifndef NTSYSAPI +#define NTSYSAPI +#endif + +#ifndef NTAPI +#define NTAPI STDCALL +#endif + + +/* GLOBALS *******************************************************************/ + +POBJECT_TYPE EXPORTED ExEventPairObjectType = NULL; + +static GENERIC_MAPPING ExEventPairMapping = { + STANDARD_RIGHTS_READ, + STANDARD_RIGHTS_WRITE, + STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE, + EVENT_PAIR_ALL_ACCESS}; + +static KSPIN_LOCK ExThreadEventPairSpinLock; + +/* FUNCTIONS *****************************************************************/ + +NTSTATUS STDCALL +ExpCreateEventPair(PVOID ObjectBody, + PVOID Parent, + PWSTR RemainingPath, + POBJECT_ATTRIBUTES ObjectAttributes) +{ + DPRINT("ExpCreateEventPair(ObjectBody %x, Parent %x, RemainingPath %S)\n", + ObjectBody, Parent, RemainingPath); + + if (RemainingPath != NULL && wcschr(RemainingPath+1, '\\') != NULL) + { + return(STATUS_UNSUCCESSFUL); + } + + return(STATUS_SUCCESS); +} + +VOID INIT_FUNCTION +ExpInitializeEventPairImplementation(VOID) +{ + ExEventPairObjectType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE)); + + RtlCreateUnicodeString(&ExEventPairObjectType->TypeName, L"EventPair"); + ExEventPairObjectType->Tag = TAG('E', 'v', 'P', 'a'); + ExEventPairObjectType->PeakObjects = 0; + ExEventPairObjectType->PeakHandles = 0; + ExEventPairObjectType->TotalObjects = 0; + ExEventPairObjectType->TotalHandles = 0; + ExEventPairObjectType->PagedPoolCharge = 0; + ExEventPairObjectType->NonpagedPoolCharge = sizeof(KEVENT_PAIR); + ExEventPairObjectType->Mapping = &ExEventPairMapping; + ExEventPairObjectType->Dump = NULL; + ExEventPairObjectType->Open = NULL; + ExEventPairObjectType->Close = NULL; + ExEventPairObjectType->Delete = NULL; + ExEventPairObjectType->Parse = NULL; + ExEventPairObjectType->Security = NULL; + ExEventPairObjectType->QueryName = NULL; + ExEventPairObjectType->OkayToClose = NULL; + ExEventPairObjectType->Create = ExpCreateEventPair; + ExEventPairObjectType->DuplicationNotify = NULL; + + KeInitializeSpinLock(&ExThreadEventPairSpinLock); + ObpCreateTypeObject(ExEventPairObjectType); +} + + +NTSTATUS STDCALL +NtCreateEventPair(OUT PHANDLE EventPairHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes) +{ + PKEVENT_PAIR EventPair; + NTSTATUS Status; + + DPRINT("NtCreateEventPair()\n"); + Status = ObCreateObject(ExGetPreviousMode(), + ExEventPairObjectType, + ObjectAttributes, + ExGetPreviousMode(), + NULL, + sizeof(KEVENT_PAIR), + 0, + 0, + (PVOID*)&EventPair); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + + KeInitializeEvent(&EventPair->LowEvent, + SynchronizationEvent, + FALSE); + KeInitializeEvent(&EventPair->HighEvent, + SynchronizationEvent, + FALSE); + + Status = ObInsertObject ((PVOID)EventPair, + NULL, + DesiredAccess, + 0, + NULL, + EventPairHandle); + + ObDereferenceObject(EventPair); + + return Status; +} + + +NTSTATUS STDCALL +NtOpenEventPair(OUT PHANDLE EventPairHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes) +{ + NTSTATUS Status; + + DPRINT("NtOpenEventPair()\n"); + + Status = ObOpenObjectByName(ObjectAttributes, + ExEventPairObjectType, + NULL, + UserMode, + DesiredAccess, + NULL, + EventPairHandle); + + return Status; +} + + +NTSTATUS STDCALL +NtSetHighEventPair(IN HANDLE EventPairHandle) +{ + PKEVENT_PAIR EventPair; + NTSTATUS Status; + + DPRINT("NtSetHighEventPair(EventPairHandle %x)\n", + EventPairHandle); + + Status = ObReferenceObjectByHandle(EventPairHandle, + EVENT_PAIR_ALL_ACCESS, + ExEventPairObjectType, + UserMode, + (PVOID*)&EventPair, + NULL); + if (!NT_SUCCESS(Status)) + return(Status); + + KeSetEvent(&EventPair->HighEvent, + EVENT_INCREMENT, + FALSE); + + ObDereferenceObject(EventPair); + return(STATUS_SUCCESS); +} + + +NTSTATUS STDCALL +NtSetHighWaitLowEventPair(IN HANDLE EventPairHandle) +{ + PKEVENT_PAIR EventPair; + NTSTATUS Status; + + DPRINT("NtSetHighWaitLowEventPair(EventPairHandle %x)\n", + EventPairHandle); + + Status = ObReferenceObjectByHandle(EventPairHandle, + EVENT_PAIR_ALL_ACCESS, + ExEventPairObjectType, + UserMode, + (PVOID*)&EventPair, + NULL); + if (!NT_SUCCESS(Status)) + return(Status); + + KeSetEvent(&EventPair->HighEvent, + EVENT_INCREMENT, + TRUE); + + KeWaitForSingleObject(&EventPair->LowEvent, + WrEventPair, + UserMode, + FALSE, + NULL); + + ObDereferenceObject(EventPair); + return(STATUS_SUCCESS); +} + + +NTSTATUS STDCALL +NtSetLowEventPair(IN HANDLE EventPairHandle) +{ + PKEVENT_PAIR EventPair; + NTSTATUS Status; + + DPRINT("NtSetLowEventPair(EventPairHandle %x)\n", + EventPairHandle); + + Status = ObReferenceObjectByHandle(EventPairHandle, + EVENT_PAIR_ALL_ACCESS, + ExEventPairObjectType, + UserMode, + (PVOID*)&EventPair, + NULL); + if (!NT_SUCCESS(Status)) + return(Status); + + KeSetEvent(&EventPair->LowEvent, + EVENT_INCREMENT, + FALSE); + + ObDereferenceObject(EventPair); + return(STATUS_SUCCESS); +} + + +NTSTATUS STDCALL +NtSetLowWaitHighEventPair(IN HANDLE EventPairHandle) +{ + PKEVENT_PAIR EventPair; + NTSTATUS Status; + + DPRINT("NtSetLowWaitHighEventPair(EventPairHandle %x)\n", + EventPairHandle); + + Status = ObReferenceObjectByHandle(EventPairHandle, + EVENT_PAIR_ALL_ACCESS, + ExEventPairObjectType, + UserMode, + (PVOID*)&EventPair, + NULL); + if (!NT_SUCCESS(Status)) + return(Status); + + KeSetEvent(&EventPair->LowEvent, + EVENT_INCREMENT, + TRUE); + + KeWaitForSingleObject(&EventPair->HighEvent, + WrEventPair, + UserMode, + FALSE, + NULL); + + ObDereferenceObject(EventPair); + return(STATUS_SUCCESS); +} + + +NTSTATUS STDCALL +NtWaitLowEventPair(IN HANDLE EventPairHandle) +{ + PKEVENT_PAIR EventPair; + NTSTATUS Status; + + DPRINT("NtWaitLowEventPair(EventPairHandle %x)\n", + EventPairHandle); + + Status = ObReferenceObjectByHandle(EventPairHandle, + EVENT_PAIR_ALL_ACCESS, + ExEventPairObjectType, + UserMode, + (PVOID*)&EventPair, + NULL); + if (!NT_SUCCESS(Status)) + return(Status); + + KeWaitForSingleObject(&EventPair->LowEvent, + WrEventPair, + UserMode, + FALSE, + NULL); + + ObDereferenceObject(EventPair); + return(STATUS_SUCCESS); +} + + +NTSTATUS STDCALL +NtWaitHighEventPair(IN HANDLE EventPairHandle) +{ + PKEVENT_PAIR EventPair; + NTSTATUS Status; + + DPRINT("NtWaitHighEventPair(EventPairHandle %x)\n", + EventPairHandle); + + Status = ObReferenceObjectByHandle(EventPairHandle, + EVENT_PAIR_ALL_ACCESS, + ExEventPairObjectType, + UserMode, + (PVOID*)&EventPair, + NULL); + if (!NT_SUCCESS(Status)) + return(Status); + + KeWaitForSingleObject(&EventPair->HighEvent, + WrEventPair, + UserMode, + FALSE, + NULL); + + ObDereferenceObject(EventPair); + return(STATUS_SUCCESS); +} + +#ifdef _ENABLE_THRDEVTPAIR + +/* + * Author: Skywing (skywing(a)valhallalegends.com), 09/08/2003 + * Note that the eventpair spinlock must be acquired when setting the thread + * eventpair via NtSetInformationThread. + * @implemented + */ +NTSTATUS +NTSYSAPI +NTAPI +NtSetLowWaitHighThread( + VOID + ) +{ + PETHREAD Thread; + PKEVENT_PAIR EventPair; + NTSTATUS Status; + KIRQL Irql; + + Thread = PsGetCurrentThread(); + + if(!Thread->EventPair) + return STATUS_NO_EVENT_PAIR; + + KeAcquireSpinLock(&ExThreadEventPairSpinLock, &Irql); + + EventPair = Thread->EventPair; + + if(EventPair) + ObReferenceObjectByPointer(EventPair, + EVENT_PAIR_ALL_ACCESS, + ExEventPairObjectType, + UserMode); + + KeReleaseSpinLock(&ExThreadEventPairSpinLock, Irql); [truncated at 1000 lines; 2285 more skipped]
19 years, 11 months
1
0
0
0
[blight] 12860: added agp.c First try of implementing the AGP functions (Untested)
by blight@svn.reactos.com
added agp.c First try of implementing the AGP functions (Untested) added ddc.c First try of implementing DDC functions (Untested) modified dispatch.c Handle IRP_MJ_PNP:IRP_MN_START_DEVICE. Let AddDevice create the device object and call HwFindAdapter from IRP_MN_START_DEVICE. modified int10.c Make VideoPortInt10 return ERROR_INVALID_PARAMETER when called while CSRSS is not initialized. modified Makefile Add agp.o and ddc.o modified resource.c Don't remember usermode mappings - they are valid only in the context of the process which they were created in. Add IntVideoPortMapPhysicalMemory() to map part of \Device\PhysicalMemory into UserMode. Make VideoPortGetAccessRanges use DeviceExtension->AllocatedResources (from the IRP_MJ_PNP:IRP_MN_START_DEVICE) if present. modified services.c Implement VideoPortGetAgpServices. VideoPortQueryServices support for VideoPortServicesAGP. modified videoprt.c Split IntVideoPortFindAdapter into IntVideoPortCreateAdapterDeviceObject and IntVideoPortFindAdapter. Basic implementation of VideoPortEnumerateChildren. Implement VideoPortAcquireDeviceLock/VideoPortReleaseDeviceLock. modified videoprt.def Export VideoPortAcquireDeviceLock/VideoPortReleaseDeviceLock. modified videoprt.h Various stuff. Modified: trunk/reactos/drivers/video/videoprt/Makefile Added: trunk/reactos/drivers/video/videoprt/agp.c Added: trunk/reactos/drivers/video/videoprt/ddc.c Modified: trunk/reactos/drivers/video/videoprt/dispatch.c Modified: trunk/reactos/drivers/video/videoprt/int10.c Modified: trunk/reactos/drivers/video/videoprt/resource.c Modified: trunk/reactos/drivers/video/videoprt/services.c Modified: trunk/reactos/drivers/video/videoprt/videoprt.c Modified: trunk/reactos/drivers/video/videoprt/videoprt.def Modified: trunk/reactos/drivers/video/videoprt/videoprt.h _____ Modified: trunk/reactos/drivers/video/videoprt/Makefile --- trunk/reactos/drivers/video/videoprt/Makefile 2005-01-07 00:02:56 UTC (rev 12859) +++ trunk/reactos/drivers/video/videoprt/Makefile 2005-01-07 01:03:34 UTC (rev 12860) @@ -9,6 +9,8 @@ TARGET_CFLAGS += -Wall -Werror -D__USE_W32API -I$(PATH_TO_TOP)/ntoskrnl/include TARGET_OBJECTS = \ + agp.o \ + ddc.o \ dispatch.o \ dma.o \ event.o \ _____ Added: trunk/reactos/drivers/video/videoprt/agp.c --- trunk/reactos/drivers/video/videoprt/agp.c 2005-01-07 00:02:56 UTC (rev 12859) +++ trunk/reactos/drivers/video/videoprt/agp.c 2005-01-07 01:03:34 UTC (rev 12860) @@ -0,0 +1,566 @@ +/* + * VideoPort driver + * + * Copyright (C) 2002, 2003, 2004 ReactOS Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; see the file COPYING.LIB. + * If not, write to the Free Software Foundation, + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + */ + +#include "videoprt.h" +#include <initguid.h> +#include <ddk/wdmguid.h> + +/* PRIVATE FUNCTIONS **********************************************************/ + +STATIC NTSTATUS +IopInitiatePnpIrp( + PDEVICE_OBJECT DeviceObject, + PIO_STATUS_BLOCK IoStatusBlock, + ULONG MinorFunction, + PIO_STACK_LOCATION Stack OPTIONAL) +{ + PDEVICE_OBJECT TopDeviceObject; + PIO_STACK_LOCATION IrpSp; + NTSTATUS Status; + KEVENT Event; + PIRP Irp; + + /* Always call the top of the device stack */ + TopDeviceObject = IoGetAttachedDeviceReference(DeviceObject); + + KeInitializeEvent( + &Event, + NotificationEvent, + FALSE); + + Irp = IoBuildSynchronousFsdRequest( + IRP_MJ_PNP, + TopDeviceObject, + NULL, + 0, + NULL, + &Event, + IoStatusBlock); + + /* PNP IRPs are always initialized with a status code of + STATUS_NOT_IMPLEMENTED */ + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + Irp->IoStatus.Information = 0; + + IrpSp = IoGetNextIrpStackLocation(Irp); + IrpSp->MinorFunction = MinorFunction; + + if (Stack) + { + RtlMoveMemory( + &IrpSp->Parameters, + &Stack->Parameters, + sizeof(Stack->Parameters)); + } + + Status = IoCallDriver(TopDeviceObject, Irp); + if (Status == STATUS_PENDING) + { + KeWaitForSingleObject( + &Event, + Executive, + KernelMode, + FALSE, + NULL); + Status = IoStatusBlock->Status; + } + + ObDereferenceObject(TopDeviceObject); + + return Status; +} + + +BOOLEAN STDCALL +IntAgpCommitPhysical( + IN PVOID HwDeviceExtension, + IN PVOID PhysicalContext, + IN ULONG Pages, + IN ULONG Offset) +{ + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; + PAGP_BUS_INTERFACE_STANDARD AgpBusInterface; + PHYSICAL_ADDRESS MappingAddr = {{0}}; + PVIDEO_PORT_AGP_MAPPING AgpMapping; + NTSTATUS Status; + + DPRINT("AgpCommitPhysical - PhysicalContext: 0x%x Pages: %d, Offset: 0x%x\n", + PhysicalContext, Pages, Offset); + + DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); + AgpBusInterface = &DeviceExtension->AgpInterface; + AgpMapping = (PVIDEO_PORT_AGP_MAPPING)PhysicalContext; + + Status = AgpBusInterface->CommitMemory(AgpBusInterface->AgpContext, + AgpMapping->MapHandle, Pages, Offset, + NULL, &MappingAddr); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Warning: AgpBusInterface->CommitMemory failed (Status = 0x%x)\n", + Status); + } + return NT_SUCCESS(Status); +} + +VOID STDCALL +IntAgpFreePhysical( + IN PVOID HwDeviceExtension, + IN PVOID PhysicalContext, + IN ULONG Pages, + IN ULONG Offset) +{ + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; + PAGP_BUS_INTERFACE_STANDARD AgpBusInterface; + PVIDEO_PORT_AGP_MAPPING AgpMapping; + NTSTATUS Status; + + DPRINT("AgpFreePhysical - PhysicalContext: 0x%x Pages: %d, Offset: 0x%x\n", + PhysicalContext, Pages, Offset); + + DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); + AgpBusInterface = &DeviceExtension->AgpInterface; + AgpMapping = (PVIDEO_PORT_AGP_MAPPING)PhysicalContext; + + Status = AgpBusInterface->FreeMemory(AgpBusInterface->AgpContext, + AgpMapping->MapHandle, Pages, Offset); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Warning: AgpBusInterface->FreeMemory failed (Status = 0x%x)\n", + Status); + } +} + +VOID STDCALL +IntAgpReleasePhysical( + IN PVOID HwDeviceExtension, + IN PVOID PhysicalContext) +{ + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; + PAGP_BUS_INTERFACE_STANDARD AgpBusInterface; + PVIDEO_PORT_AGP_MAPPING AgpMapping; + NTSTATUS Status; + + DPRINT("AgpReleasePhysical - PhysicalContext: 0x%x\n", PhysicalContext); + + DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); + AgpBusInterface = &DeviceExtension->AgpInterface; + AgpMapping = (PVIDEO_PORT_AGP_MAPPING)PhysicalContext; + + /* Release memory */ + Status = AgpBusInterface->ReleaseMemory(AgpBusInterface->AgpContext, + AgpMapping->MapHandle); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Warning: AgpBusInterface->ReleaseMemory failed (Status = 0x%x)\n", + Status); + } + + /* Free resources */ + ExFreePool(AgpMapping); +} + +PHYSICAL_ADDRESS STDCALL +IntAgpReservePhysical( + IN PVOID HwDeviceExtension, + IN ULONG Pages, + IN VIDEO_PORT_CACHE_TYPE Caching, + OUT PVOID *PhysicalContext) +{ + PHYSICAL_ADDRESS ZeroAddress = {{0}}; + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; + PAGP_BUS_INTERFACE_STANDARD AgpBusInterface; + MEMORY_CACHING_TYPE MemCachingType; + PVIDEO_PORT_AGP_MAPPING AgpMapping; + NTSTATUS Status; + + DPRINT("AgpReservePhysical - Pages: %d, Caching: 0x%x\n", Pages, Caching); + + DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); + AgpBusInterface = &DeviceExtension->AgpInterface; + + /* Translate memory caching type */ + if (Caching == VpNonCached) + MemCachingType = MmNonCached; + else if (Caching == VpCached) + MemCachingType = MmCached; + else if (Caching == VpWriteCombined) + MemCachingType = MmWriteCombined; + else + { + DPRINT1("Invalid caching type %d!\n", Caching); + return ZeroAddress; + } + + /* Allocate an AGP mapping structure */ + AgpMapping = ExAllocatePoolWithTag(PagedPool, + sizeof(VIDEO_PORT_AGP_MAPPING), + TAG_VIDEO_PORT); + if (AgpMapping == NULL) + { + DPRINT1("Out of memory! Couldn't allocate AGP mapping structure!\n"); + return ZeroAddress; + } + RtlZeroMemory(AgpMapping, sizeof(VIDEO_PORT_AGP_MAPPING)); + + /* Reserve memory for the AGP bus */ + Status = AgpBusInterface->ReserveMemory(AgpBusInterface->AgpContext, + Pages, + MemCachingType, + &AgpMapping->MapHandle, + &AgpMapping->PhysicalAddress); + if (!NT_SUCCESS(Status) || AgpMapping->MapHandle == NULL) + { + ExFreePool(AgpMapping); + DPRINT1("Warning: AgpBusInterface->ReserveMemory failed (Status = 0x%x)\n", + Status); + return ZeroAddress; + } + + /* Fill the rest of the AGP mapping */ + AgpMapping->NumberOfPages = Pages; + + *PhysicalContext = (PVOID)AgpMapping; + return AgpMapping->PhysicalAddress; +} + + +PVOID STDCALL +IntAgpCommitVirtual( + IN PVOID HwDeviceExtension, + IN PVOID VirtualContext, + IN ULONG Pages, + IN ULONG Offset) +{ + PVIDEO_PORT_AGP_VIRTUAL_MAPPING VirtualMapping; + PVOID BaseAddress = NULL; + NTSTATUS Status; + + DPRINT("AgpCommitVirtual - VirtualContext: 0x%x Pages: %d, Offset: 0x%x\n", + VirtualContext, Pages, Offset); + + VirtualMapping = (PVIDEO_PORT_AGP_VIRTUAL_MAPPING)VirtualContext; + + /* I think the NT API provides no way of reserving a part of the address space + * and setting it up to map into a specified range of physical memory later. + * This means that we will have to release some of the reserved virtual memory + * and map the physical memory into it using MapViewOfSection. + * + * - blight (2004-12-21) + */ + + if (VirtualMapping->ProcessHandle == NULL) + { + /* FIXME: not implemented */ + } + else /* ProcessHandle != NULL */ + { + /* Release some virtual memory */ + ULONG Size = Pages * PAGE_SIZE; + ULONG OffsetInBytes = Offset * PAGE_SIZE; + BaseAddress = (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress + + OffsetInBytes); + PHYSICAL_ADDRESS PhysicalAddress = VirtualMapping->AgpMapping->PhysicalAddress; + PhysicalAddress.QuadPart += OffsetInBytes; + + Status = ZwFreeVirtualMemory(VirtualMapping->ProcessHandle, + &BaseAddress, + &Size, MEM_RELEASE); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Warning: ZwFreeVirtualMemory() failed: Status = 0x%x\n", Status); + return NULL; + } + ASSERT(Size == Pages * PAGE_SIZE); + ASSERT(BaseAddress == (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress + + OffsetInBytes)); + + /* Map the physical memory into the released virtual memory area */ + Status = IntVideoPortMapPhysicalMemory(VirtualMapping->ProcessHandle, + PhysicalAddress, + Size, + PAGE_READWRITE, + &BaseAddress); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Warning: IntVideoPortMapPhysicalMemory() failed: Status = 0x%x\n", Status); + /* Reserve the released virtual memory area again */ + Status = ZwAllocateVirtualMemory(VirtualMapping->ProcessHandle, + &BaseAddress, 0, &Size, MEM_RESERVE, + PAGE_NOACCESS); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Warning: ZwAllocateVirtualMemory() failed: Status = 0x%x\n", Status); + /* FIXME: What to do now?? */ + ASSERT(0); + return NULL; + } + ASSERT(Size == Pages * PAGE_SIZE); + ASSERT(BaseAddress == (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress + + OffsetInBytes)); + return NULL; + } + ASSERT(BaseAddress == (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress + + OffsetInBytes)); + } + + return BaseAddress; +} + +VOID STDCALL +IntAgpFreeVirtual( + IN PVOID HwDeviceExtension, + IN PVOID VirtualContext, + IN ULONG Pages, + IN ULONG Offset) +{ + PVIDEO_PORT_AGP_VIRTUAL_MAPPING VirtualMapping; + PVOID BaseAddress = NULL; + NTSTATUS Status; + + DPRINT("AgpFreeVirtual - VirtualContext: 0x%x Pages: %d, Offset: 0x%x\n", + VirtualContext, Pages, Offset); + + VirtualMapping = (PVIDEO_PORT_AGP_VIRTUAL_MAPPING)VirtualContext; + + if (VirtualMapping->ProcessHandle == NULL) + { + /* FIXME: not implemented */ + } + else /* ProcessHandle != NULL */ + { + /* Unmap the section view */ + ULONG Size = Pages * PAGE_SIZE; + ULONG OffsetInBytes = Offset * PAGE_SIZE; + BaseAddress = (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress + + OffsetInBytes); + + Status = ZwUnmapViewOfSection(VirtualMapping->ProcessHandle, BaseAddress); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Warning: ZwUnmapViewOfSection() failed: Status = 0x%x\n", Status); + /* FIXME: What to do now?? */ + ASSERT(0); + return; + } + + /* And reserve the virtual memory area again */ + Status = ZwAllocateVirtualMemory(VirtualMapping->ProcessHandle, + &BaseAddress, 0, &Size, MEM_RESERVE, + PAGE_NOACCESS); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Warning: ZwAllocateVirtualMemory() failed: Status = 0x%x\n", Status); + /* FIXME: What to do now?? */ + ASSERT(0); + return; + } + ASSERT(Size == Pages * PAGE_SIZE); + ASSERT(BaseAddress == (PVOID)((ULONG_PTR)VirtualMapping->MappedAddress + + OffsetInBytes)); + } +} + +VOID STDCALL +IntAgpReleaseVirtual( + IN PVOID HwDeviceExtension, + IN PVOID VirtualContext) +{ + PVIDEO_PORT_AGP_VIRTUAL_MAPPING VirtualMapping; + NTSTATUS Status; + + DPRINT("AgpReleaseVirtual - VirtualContext: 0x%x\n", VirtualContext); + + VirtualMapping = (PVIDEO_PORT_AGP_VIRTUAL_MAPPING)VirtualContext; + + /* Release the virtual memory */ + if (VirtualMapping->ProcessHandle == NULL) + { + /* FIXME: not implemented */ + } + else /* ProcessHandle != NULL */ + { + /* Release the allocated virtual memory */ + ULONG Size = VirtualMapping->AgpMapping->NumberOfPages * PAGE_SIZE; + Status = ZwFreeVirtualMemory(VirtualMapping->ProcessHandle, + &VirtualMapping->MappedAddress, + &Size, MEM_RELEASE); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Warning: ZwFreeVirtualMemory() failed: Status = 0x%x\n", Status); + } + } + + /* Free resources */ + ExFreePool(VirtualMapping); +} + +PVOID STDCALL +IntAgpReserveVirtual( + IN PVOID HwDeviceExtension, + IN HANDLE ProcessHandle, + IN PVOID PhysicalContext, + OUT PVOID *VirtualContext) +{ + PVIDEO_PORT_AGP_MAPPING AgpMapping; + PVIDEO_PORT_AGP_VIRTUAL_MAPPING VirtualMapping; + PVOID MappedAddress; + NTSTATUS Status; + + DPRINT("AgpReserveVirtual - ProcessHandle: 0x%x PhysicalContext: 0x%x\n", + ProcessHandle, PhysicalContext); + + AgpMapping = (PVIDEO_PORT_AGP_MAPPING)PhysicalContext; + + /* Allocate an AGP virtual mapping structure */ + VirtualMapping = ExAllocatePoolWithTag(PagedPool, + sizeof(VIDEO_PORT_AGP_VIRTUAL_MAPPING), + TAG_VIDEO_PORT); + if (VirtualMapping == NULL) + { + DPRINT1("Out of memory! Couldn't allocate AGP virtual mapping structure!\n"); + return NULL; + } + RtlZeroMemory(VirtualMapping, sizeof(VIDEO_PORT_AGP_VIRTUAL_MAPPING)); + + /* Reserve a virtual memory area for the physical pages. */ + if (ProcessHandle == NULL) + { + /* FIXME: What to do in this case? */ + ExFreePool(VirtualMapping); + return NULL; + } + else /* ProcessHandle != NULL */ + { + /* Reserve memory for usermode */ + ULONG Size = AgpMapping->NumberOfPages * PAGE_SIZE; + MappedAddress = NULL; + Status = ZwAllocateVirtualMemory(ProcessHandle, &MappedAddress, 0, &Size, + MEM_RESERVE, PAGE_NOACCESS); + if (!NT_SUCCESS(Status)) + { + ExFreePool(VirtualMapping); + DPRINT("ZwAllocateVirtualMemory() failed: Status = 0x%x\n", Status); + return NULL; + } + } + + /* Fill the AGP virtual mapping */ + VirtualMapping->AgpMapping = AgpMapping; + VirtualMapping->ProcessHandle = ProcessHandle; + VirtualMapping->MappedAddress = MappedAddress; + + *VirtualContext = (PVOID)VirtualMapping; + return MappedAddress; +} + + +BOOLEAN STDCALL +IntAgpSetRate( + IN PVOID HwDeviceExtension, + IN ULONG Rate) +{ + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; + PAGP_BUS_INTERFACE_STANDARD AgpBusInterface; + + DPRINT("AgpSetRate - Rate: %d\n", Rate); + + DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); + AgpBusInterface = &DeviceExtension->AgpInterface; + + return NT_SUCCESS(AgpBusInterface->SetRate(AgpBusInterface->AgpContext, Rate)); +} + + +NTSTATUS STDCALL +IntAgpGetInterface( + IN PVOID HwDeviceExtension, + IN OUT PINTERFACE Interface) +{ + IO_STATUS_BLOCK IoStatusBlock; + IO_STACK_LOCATION IoStack; + NTSTATUS Status; + PVIDEO_PORT_AGP_INTERFACE_2 AgpInterface; + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; + PAGP_BUS_INTERFACE_STANDARD AgpBusInterface; + + DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); + AgpBusInterface = &DeviceExtension->AgpInterface; + AgpInterface = (PVIDEO_PORT_AGP_INTERFACE_2)Interface; + + ASSERT((Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_2 && + Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE_2)) || + (Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_1 && + Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE))); + + if (DeviceExtension->NextDeviceObject == NULL) + { + DPRINT("DeviceExtension->NextDeviceObject is NULL!\n"); + return STATUS_UNSUCCESSFUL; + } + + /* Query the interface from the AGP bus driver */ + if (DeviceExtension->AgpInterface.Size == 0) + { + AgpBusInterface->Size = sizeof(AGP_BUS_INTERFACE_STANDARD); + if (Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_1) + AgpBusInterface->Version = AGP_BUS_INTERFACE_V1; + else /* if (InterfaceVersion == VIDEO_PORT_AGP_INTERFACE_VERSION_2) */ + AgpBusInterface->Version = AGP_BUS_INTERFACE_V2; + IoStack.Parameters.QueryInterface.Size = AgpBusInterface->Size; + IoStack.Parameters.QueryInterface.Version = AgpBusInterface->Version; + IoStack.Parameters.QueryInterface.Interface = (PINTERFACE)AgpBusInterface; + IoStack.Parameters.QueryInterface.InterfaceType = + &GUID_AGP_TARGET_BUS_INTERFACE_STANDARD; + Status = IopInitiatePnpIrp(DeviceExtension->NextDeviceObject, + &IoStatusBlock, IRP_MN_QUERY_INTERFACE, &IoStack); + if (!NT_SUCCESS(Status)) + { + DPRINT("IopInitiatePnpIrp() failed! (Status 0x%x)\n", Status); + return Status; + } + DPRINT("Got AGP driver interface!\n"); + } + + /* FIXME: Not sure if we should wrap the reference/dereference functions */ + AgpInterface->Context = AgpBusInterface->AgpContext; + AgpInterface->InterfaceReference = AgpBusInterface->InterfaceReference; + AgpInterface->InterfaceDereference = AgpBusInterface->InterfaceDereference; + AgpInterface->AgpReservePhysical = IntAgpReservePhysical; + AgpInterface->AgpReleasePhysical = IntAgpReleasePhysical; + AgpInterface->AgpCommitPhysical = IntAgpCommitPhysical; + AgpInterface->AgpFreePhysical = IntAgpFreePhysical; + AgpInterface->AgpReserveVirtual = IntAgpReserveVirtual; + AgpInterface->AgpReleaseVirtual = IntAgpReleaseVirtual; + AgpInterface->AgpCommitVirtual = IntAgpCommitVirtual; + AgpInterface->AgpFreeVirtual = IntAgpFreeVirtual; + AgpInterface->AgpAllocationLimit = 0x1000000; /* FIXME: using 16 MB for now */ + + if (AgpInterface->Version >= VIDEO_PORT_AGP_INTERFACE_VERSION_2) + { + AgpInterface->AgpSetRate = IntAgpSetRate; + } + + return STATUS_SUCCESS; +} + _____ Added: trunk/reactos/drivers/video/videoprt/ddc.c --- trunk/reactos/drivers/video/videoprt/ddc.c 2005-01-07 00:02:56 UTC (rev 12859) +++ trunk/reactos/drivers/video/videoprt/ddc.c 2005-01-07 01:03:34 UTC (rev 12860) @@ -0,0 +1,227 @@ +/* + * VideoPort driver + * + * Copyright (C) 2002, 2003, 2004 ReactOS Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; see the file COPYING.LIB. + * If not, write to the Free Software Foundation, + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + */ + +#include "videoprt.h" + +#define DDC_EEPROM_ADDRESS 0xA0 + +/* PRIVATE FUNCTIONS **********************************************************/ + +#define LOW 0 +#define HIGH 1 +#define WRITE 0 +#define READ 1 +#define READ_SDA() (i2c->ReadDataLine(HwDeviceExtension)) +#define READ_SCL() (i2c->ReadClockLine(HwDeviceExtension)) +#define WRITE_SDA(state) (i2c->WriteDataLine(HwDeviceExtension, state)) +#define WRITE_SCL(state) (i2c->WriteClockLine(HwDeviceExtension, state)) + +STATIC LARGE_INTEGER HalfPeriodDelay = { { 70LL } }; +#define DELAY_HALF() KeDelayExecutionThread(KernelMode, FALSE, &HalfPeriodDelay) + + +STATIC BOOL +I2CWrite(PVOID HwDeviceExtension, PI2C_CALLBACKS i2c, UCHAR Data) +{ + UCHAR Bit; + BOOL Ack; + + /* transmit data */ + for (Bit = (1 << 7); Bit != 0; Bit >>= 1) + { + WRITE_SCL(LOW); + WRITE_SDA((Data & Bit) ? HIGH : LOW); + DELAY_HALF(); + WRITE_SCL(HIGH); + DELAY_HALF(); + } + + /* get ack */ + WRITE_SCL(LOW); + WRITE_SDA(HIGH); + DELAY_HALF(); + WRITE_SCL(HIGH); + do + { + DELAY_HALF(); + } + while (READ_SCL() != HIGH); + Ack = (READ_SDA() == LOW); + DELAY_HALF(); + + DPRINT("I2CWrite: %s\n", Ack ? "Ack" : "Nak"); + return Ack; +} + + +STATIC UCHAR +I2CRead(PVOID HwDeviceExtension, PI2C_CALLBACKS i2c, BOOL Ack) +{ + INT Bit = 0x80; + UCHAR Data = 0; + + /* pull down SCL and release SDA */ + WRITE_SCL(LOW); + WRITE_SDA(HIGH); + + /* read byte */ + for (Bit = (1 << 7); Bit != 0; Bit >>= 1) + { + WRITE_SCL(LOW); + DELAY_HALF(); + WRITE_SCL(HIGH); + DELAY_HALF(); + if (READ_SDA() == HIGH) + Data |= Bit; + } + + /* send ack/nak */ + WRITE_SCL(LOW); + WRITE_SDA(Ack ? LOW : HIGH); + DELAY_HALF(); + WRITE_SCL(HIGH); + do + { + DELAY_HALF(); + } + while (READ_SCL() != HIGH); + + return Data; +} + + +STATIC VOID +I2CStop(PVOID HwDeviceExtension, PI2C_CALLBACKS i2c) +{ + WRITE_SCL(LOW); + WRITE_SDA(LOW); + DELAY_HALF(); + WRITE_SCL(HIGH); + DELAY_HALF(); + WRITE_SDA(HIGH); +} + + +STATIC BOOL +I2CStart(PVOID HwDeviceExtension, PI2C_CALLBACKS i2c, UCHAR Address) +{ + /* make sure the bus is free */ + if (READ_SDA() == LOW || READ_SCL() == LOW) + { + DPRINT1("I2CStart: Bus is not free!\n"); + return FALSE; + } + + /* send address */ + WRITE_SDA(LOW); + DELAY_HALF(); + if (!I2CWrite(HwDeviceExtension, i2c, Address)) + { + /* ??release the bus?? */ + I2CStop(HwDeviceExtension, i2c); + DPRINT1("I2CStart: Device not found (Address = 0x%x)\n", Address); + return FALSE; + } + + DPRINT("I2CStart: SUCCESS!\n"); + return TRUE; +} + + +STATIC BOOL +I2CRepStart(PVOID HwDeviceExtension, PI2C_CALLBACKS i2c, UCHAR Address) +{ + /* setup lines for repeated start condition */ + WRITE_SCL(LOW); + DELAY_HALF(); + WRITE_SDA(HIGH); + DELAY_HALF(); + WRITE_SCL(HIGH); + DELAY_HALF(); + + return I2CStart(HwDeviceExtension, i2c, Address); +} + +/* PUBLIC FUNCTIONS ***********************************************************/ + +/* + * @implemented + */ + +BOOLEAN STDCALL +VideoPortDDCMonitorHelper( + PVOID HwDeviceExtension, + PVOID I2CFunctions, + PUCHAR pEdidBuffer, + ULONG EdidBufferSize + ) +{ + PDDC_CONTROL ddc = (PDDC_CONTROL)I2CFunctions; + PI2C_CALLBACKS i2c = &ddc->I2CCallbacks; + INT Count, i; + PUCHAR pBuffer = (PUCHAR)pEdidBuffer; + BOOL Ack; + + DPRINT("VideoPortDDCMonitorHelper()\n"); + + ASSERT_IRQL(PASSIVE_LEVEL); + if (ddc->Size != sizeof (ddc)) + { + DPRINT("ddc->Size != %d (%d)\n", sizeof (ddc), ddc->Size); + return FALSE; + } + + /* select eeprom */ + if (!I2CStart(HwDeviceExtension, i2c, DDC_EEPROM_ADDRESS | WRITE)) + return FALSE; + /* set address */ + if (!I2CWrite(HwDeviceExtension, i2c, 0x00)) + return FALSE; + /* change into read mode */ + if (!I2CRepStart(HwDeviceExtension, i2c, DDC_EEPROM_ADDRESS | READ)) + return FALSE; + /* read eeprom */ + RtlZeroMemory(pEdidBuffer, EdidBufferSize); + Count = min(128, EdidBufferSize); + for (i = 0; i < Count; i++) + { + Ack = ((i + 1) < Count); + pBuffer[i] = I2CRead(HwDeviceExtension, i2c, Ack); + } + I2CStop(HwDeviceExtension, i2c); + + /* check EDID header */ + if (pBuffer[0] != 0x00 || pBuffer[1] != 0xff || + pBuffer[2] != 0xff || pBuffer[3] != 0xff || + pBuffer[4] != 0xff || pBuffer[5] != 0xff || + pBuffer[6] != 0xff || pBuffer[7] != 0x00) + { + DPRINT1("VideoPortDDCMonitorHelper(): Invalid EDID header!\n"); + return FALSE; + } + + DPRINT("VideoPortDDCMonitorHelper(): EDID version %d rev. %d\n", pBuffer[18], pBuffer[19]); + DPRINT("VideoPortDDCMonitorHelper() - SUCCESS!\n"); + return TRUE; +} + _____ Modified: trunk/reactos/drivers/video/videoprt/dispatch.c --- trunk/reactos/drivers/video/videoprt/dispatch.c 2005-01-07 00:02:56 UTC (rev 12859) +++ trunk/reactos/drivers/video/videoprt/dispatch.c 2005-01-07 01:03:34 UTC (rev 12860) @@ -78,13 +78,14 @@ DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject); /* - * Use generic routine to find the adapter and create device object. + * Create adapter device object. */ - return IntVideoPortFindAdapter( + return IntVideoPortCreateAdapterDeviceObject( DriverObject, DriverExtension, - PhysicalDeviceObject); + PhysicalDeviceObject, + NULL); } /* @@ -265,34 +266,177 @@ } NTSTATUS STDCALL +IntVideoPortPnPStartDevice( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp); + PDRIVER_OBJECT DriverObject; + PVIDEO_PORT_DRIVER_EXTENSION DriverExtension; + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; + PCM_RESOURCE_LIST AllocatedResources; + + /* + * Get the initialization data we saved in VideoPortInitialize. + */ + + DriverObject = DeviceObject->DriverObject; + DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject); + DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + /* + * Store some resources in the DeviceExtension. + */ + + AllocatedResources = Stack->Parameters.StartDevice.AllocatedResources; + if (AllocatedResources != NULL) + { + CM_FULL_RESOURCE_DESCRIPTOR *FullList; + CM_PARTIAL_RESOURCE_DESCRIPTOR *Descriptor; + ULONG ResourceCount; + ULONG ResourceListSize; + + /* Save the resource list */ + ResourceCount = AllocatedResources->List[0].PartialResourceList.Count; + ResourceListSize = + FIELD_OFFSET(CM_RESOURCE_LIST, List[0].PartialResourceList. + PartialDescriptors[ResourceCount]); + DeviceExtension->AllocatedResources = ExAllocatePool(PagedPool, ResourceListSize); + if (DeviceExtension->AllocatedResources == NULL) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlCopyMemory(DeviceExtension->AllocatedResources, + AllocatedResources, + ResourceListSize); + + /* Get the interrupt level/vector - needed by HwFindAdapter sometimes */ + for (FullList = AllocatedResources->List; + FullList < AllocatedResources->List + AllocatedResources->Count; + FullList++) + { + /* FIXME: Is this ASSERT ok for resources from the PNP manager? */ + ASSERT(FullList->InterfaceType == PCIBus && + FullList->BusNumber == DeviceExtension->SystemIoBusNumber && + 1 == FullList->PartialResourceList.Version && + 1 == FullList->PartialResourceList.Revision); + for (Descriptor = FullList->PartialResourceList.PartialDescriptors; + Descriptor < FullList->PartialResourceList.PartialDescriptors + FullList->PartialResourceList.Count; + Descriptor++) + { + if (Descriptor->Type == CmResourceTypeInterrupt) + { + DeviceExtension->InterruptLevel = Descriptor->u.Interrupt.Level; + DeviceExtension->InterruptVector = Descriptor->u.Interrupt.Vector; + } + } + } + } + DPRINT("Interrupt level: 0x%x Interrupt Vector: 0x%x\n", + DeviceExtension->InterruptLevel, + DeviceExtension->InterruptVector); + + /* + * Create adapter device object. + */ + + return IntVideoPortFindAdapter( + DriverObject, + DriverExtension, + DeviceObject); +} + + +NTSTATUS +STDCALL +IntVideoPortForwardIrpAndWaitCompletionRoutine( + PDEVICE_OBJECT Fdo, + PIRP Irp, + PVOID Context) +{ + PKEVENT Event = Context; + + if (Irp->PendingReturned) + KeSetEvent(Event, IO_NO_INCREMENT, FALSE); + + return STATUS_MORE_PROCESSING_REQUIRED; +} + + +NTSTATUS +STDCALL +IntVideoPortForwardIrpAndWait(PDEVICE_OBJECT DeviceObject, PIRP Irp) +{ + KEVENT Event; + NTSTATUS Status; + PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension = + (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + KeInitializeEvent(&Event, NotificationEvent, FALSE); + IoCopyCurrentIrpStackLocationToNext(Irp); + IoSetCompletionRoutine(Irp, IntVideoPortForwardIrpAndWaitCompletionRoutine, + &Event, TRUE, TRUE, TRUE); + Status = IoCallDriver(DeviceExtension->NextDeviceObject, Irp); + if (Status == STATUS_PENDING) + { + KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); + Status = Irp->IoStatus.Status; + } + return Status; +} + + +NTSTATUS STDCALL IntVideoPortDispatchPnp( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { PIO_STACK_LOCATION IrpSp; + NTSTATUS Status; IrpSp = IoGetCurrentIrpStackLocation(Irp); switch (IrpSp->MinorFunction) { case IRP_MN_START_DEVICE: + Status = IntVideoPortForwardIrpAndWait(DeviceObject, Irp); + if (NT_SUCCESS(Status) && NT_SUCCESS(Irp->IoStatus.Status)) + Status = IntVideoPortPnPStartDevice(DeviceObject, Irp); + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + break; + case IRP_MN_REMOVE_DEVICE: case IRP_MN_QUERY_REMOVE_DEVICE: case IRP_MN_CANCEL_REMOVE_DEVICE: case IRP_MN_SURPRISE_REMOVAL: case IRP_MN_STOP_DEVICE: + Status = IntVideoPortForwardIrpAndWait(DeviceObject, Irp); + if (NT_SUCCESS(Status) && NT_SUCCESS(Irp->IoStatus.Status)) + Status = STATUS_SUCCESS; + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + break; + case IRP_MN_QUERY_STOP_DEVICE: [truncated at 1000 lines; 1115 more skipped]
19 years, 11 months
1
0
0
0
[blight] 12859: Add half-verbose output to target "clean".
by blight@svn.reactos.com
Add half-verbose output to target "clean". Modified: trunk/reactos/tools/helper.mk _____ Modified: trunk/reactos/tools/helper.mk --- trunk/reactos/tools/helper.mk 2005-01-06 23:18:17 UTC (rev 12858) +++ trunk/reactos/tools/helper.mk 2005-01-07 00:02:56 UTC (rev 12859) @@ -994,6 +994,10 @@ MK_CLEANDEPS := $(join $(dir $(MK_CLEANFILTERED)), $(addprefix ., $(notdir $(MK_CLEANFILTERED)))) clean: $(MK_REGTESTS_CLEAN) $(SUBDIRS:%=%_clean) + $(HALFVERBOSEECHO) [CLEAN] *.o $(MK_PCHNAME) $(MK_BASENAME).sym $(MK_BASENAME).a \ + $(MK_RESOURCE) $(MK_FULLNAME) $(MK_NOSTRIPNAME) $(MK_CLEANFILES) $(MK_CLEANDEPS) \ + $(MK_BASENAME).map junk.tmp base.tmp temp.exp $(MK_RC_BINARIES) $(MK_SPECDEF) \ + $(MK_STUBS_SRC) $(MK_GENERATED_MAKEFILE) $(TARGET_CLEAN) - $(RM) *.o $(MK_PCHNAME) $(MK_BASENAME).sym $(MK_BASENAME).a $(MK_RESOURCE) \ $(MK_FULLNAME) $(MK_NOSTRIPNAME) $(MK_CLEANFILES) $(MK_CLEANDEPS) $(MK_BASENAME).map \ junk.tmp base.tmp temp.exp $(MK_RC_BINARIES) $(MK_SPECDEF) $(MK_STUBS_SRC) \
19 years, 11 months
1
0
0
0
[blight] 12858: Forgot to commit this file - sorry!
by blight@svn.reactos.com
Forgot to commit this file - sorry! Modified: trunk/reactos/include/napi/win32.h _____ Modified: trunk/reactos/include/napi/win32.h --- trunk/reactos/include/napi/win32.h 2005-01-06 23:12:59 UTC (rev 12857) +++ trunk/reactos/include/napi/win32.h 2005-01-06 23:18:17 UTC (rev 12858) @@ -28,6 +28,8 @@ LIST_ENTRY MenuListHead; FAST_MUTEX PrivateFontListLock; LIST_ENTRY PrivateFontListHead; + FAST_MUTEX DriverObjListLock; + LIST_ENTRY DriverObjListHead; struct _KBDTABLES* KeyboardLayout; ULONG Flags; LONG GDIObjects;
19 years, 11 months
1
0
0
0
[blight] 12857: eng/driverobj.c: DRIVEROBJ implementation.
by blight@svn.reactos.com
eng/driverobj.c: DRIVEROBJ implementation. eng/semaphor.c: Implement safe semaphore functions. eng/window.c: Basic WNDOBJ implementation. include/inteng.h: IntEngXxx functions for DRIVEROBJs. main/dllmain.c: Cleanup DRIVEROBJs. makefile: Add eng/driverobj.o and eng/window.o. stubs/stubs.c, win32k.def: Add EngAllocPrivateUserMem and EngFreePrivateUserMem stubs. Added: trunk/reactos/subsys/win32k/eng/driverobj.c Modified: trunk/reactos/subsys/win32k/eng/objects.h Modified: trunk/reactos/subsys/win32k/eng/semaphor.c Added: trunk/reactos/subsys/win32k/eng/window.c Modified: trunk/reactos/subsys/win32k/include/inteng.h Modified: trunk/reactos/subsys/win32k/include/menu.h Modified: trunk/reactos/subsys/win32k/include/tags.h Modified: trunk/reactos/subsys/win32k/main/dllmain.c Modified: trunk/reactos/subsys/win32k/makefile Modified: trunk/reactos/subsys/win32k/stubs/stubs.c Modified: trunk/reactos/subsys/win32k/win32k.def _____ Added: trunk/reactos/subsys/win32k/eng/driverobj.c --- trunk/reactos/subsys/win32k/eng/driverobj.c 2005-01-06 22:22:13 UTC (rev 12856) +++ trunk/reactos/subsys/win32k/eng/driverobj.c 2005-01-06 23:12:59 UTC (rev 12857) @@ -0,0 +1,171 @@ +/* + * ReactOS W32 Subsystem + * Copyright (C) 2005 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: GDI DRIVEROBJ Functions + * FILE: subsys/win32k/eng/driverobj.c + * PROGRAMER: Gregor Anich + * REVISION HISTORY: + * 04/01/2005: Created + */ +#include <w32k.h> + + +/*!\brief Called when the process is terminated. + * + * Calls the free-proc for each existing DRIVEROBJ. + * + * \param Process Pointer to the EPROCESS struct for the process beeing terminated. + * \param Win32Process Pointer to the W32PROCESS + */ +VOID FASTCALL +IntEngCleanupDriverObjs(struct _EPROCESS *Process, + PW32PROCESS Win32Process) +{ + PDRIVERGDI DrvObjInt; + + IntEngLockProcessDriverObjs(PsGetWin32Process()); + while (!IsListEmpty(&Win32Process->DriverObjListHead)) + { + DrvObjInt = CONTAINING_RECORD(Win32Process->DriverObjListHead.Flink, + DRIVERGDI, ListEntry); + IntEngUnLockProcessDriverObjs(PsGetWin32Process()); + EngDeleteDriverObj((HDRVOBJ)(&DrvObjInt->DriverObj), TRUE, FALSE); + IntEngLockProcessDriverObjs(PsGetWin32Process()); + } + IntEngUnLockProcessDriverObjs(PsGetWin32Process()); +} + + +/* + * @implemented + */ +HDRVOBJ +STDCALL +EngCreateDriverObj( + IN PVOID pvObj, + IN FREEOBJPROC pFreeObjProc, + IN HDEV hdev + ) +{ + PDRIVERGDI DrvObjInt; + PDRIVEROBJ DrvObjUser; + + /* Create DRIVEROBJ */ + DrvObjInt = EngAllocMem(0, sizeof (DRIVERGDI), TAG_DRIVEROBJ); + if (DrvObjInt == NULL) + { + DPRINT1("Failed to allocate memory for a DRIVERGDI structure!\n"); + return NULL; + } + + /* fill user object */ + DrvObjUser = GDIToObj(DrvObjInt, DRIVER); + DrvObjUser->pvObj = pvObj; + DrvObjUser->pFreeProc = pFreeObjProc; + DrvObjUser->hdev = hdev; + DrvObjUser->dhpdev = ((GDIDEVICE*)hdev)->PDev; + + /* fill internal object */ + ExInitializeFastMutex(&DrvObjInt->Lock); + IntEngLockProcessDriverObjs(PsGetWin32Process()); + InsertTailList(&PsGetWin32Process()->DriverObjListHead, &DrvObjInt->ListEntry); + IntEngUnLockProcessDriverObjs(PsGetWin32Process()); + + return (HDRVOBJ)DrvObjUser; +} + + +/* + * @implemented + */ +BOOL +STDCALL +EngDeleteDriverObj( + IN HDRVOBJ hdo, + IN BOOL bCallBack, + IN BOOL bLocked + ) +{ + PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo; + PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER); + + /* Make sure the obj is locked */ + if (!bLocked) + { + if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock)) + { + return FALSE; + } + } + + /* Call the free-proc */ + if (bCallBack) + { + if (!DrvObjUser->pFreeProc(DrvObjUser)) + { + return FALSE; + } + } + + /* Free the DRIVEROBJ */ + IntEngLockProcessDriverObjs(PsGetWin32Process()); + RemoveEntryList(&DrvObjInt->ListEntry); + IntEngUnLockProcessDriverObjs(PsGetWin32Process()); + EngFreeMem(DrvObjInt); + + return TRUE; +} + + +/* + * @implemented + */ +PDRIVEROBJ +STDCALL +EngLockDriverObj( IN HDRVOBJ hdo ) +{ + PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo; + PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER); + + if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock)) + { + return NULL; + } + + return DrvObjUser; +} + + +/* + * @implemented + */ +BOOL +STDCALL +EngUnlockDriverObj ( IN HDRVOBJ hdo ) +{ + PDRIVERGDI DrvObjInt = ObjToGDI((PDRIVEROBJ)hdo, DRIVER); + + ExReleaseFastMutex(&DrvObjInt->Lock); + return TRUE; +} + +/* EOF */ + _____ Modified: trunk/reactos/subsys/win32k/eng/objects.h --- trunk/reactos/subsys/win32k/eng/objects.h 2005-01-06 22:22:13 UTC (rev 12856) +++ trunk/reactos/subsys/win32k/eng/objects.h 2005-01-06 23:12:59 UTC (rev 12857) @@ -51,6 +51,12 @@ ENUMRECTS EnumRects; } CLIPGDI, *PCLIPGDI; +typedef struct _DRIVERGDI { + DRIVEROBJ DriverObj; + LIST_ENTRY ListEntry; + FAST_MUTEX Lock; +} DRIVERGDI, *PDRIVERGDI; + /*ei What is this for? */ typedef struct _DRVFUNCTIONSGDI { HDEV hdev; @@ -122,6 +128,14 @@ typedef BOOL STDCALL (*PFN_GradientFill)(SURFOBJ*, CLIPOBJ*, XLATEOBJ*, TRIVERTEX*, ULONG, PVOID, ULONG, RECTL*, POINTL*, ULONG); +typedef struct _WNDGDI { + WNDOBJ WndObj; + CLIPOBJ *ClientClipObj; + WNDOBJCHANGEPROC ChangeProc; + FLONG Flags; + int PixelFormat; +} WNDGDI, *PWNDGDI; + typedef struct _XFORMGDI { ULONG Dummy; /* XFORMOBJ has no public members */ _____ Modified: trunk/reactos/subsys/win32k/eng/semaphor.c --- trunk/reactos/subsys/win32k/eng/semaphor.c 2005-01-06 22:22:13 UTC (rev 12856) +++ trunk/reactos/subsys/win32k/eng/semaphor.c 2005-01-06 23:12:59 UTC (rev 12857) @@ -80,3 +80,50 @@ ASSERT(hsem); return ExIsResourceAcquiredExclusiveLite ( (PERESOURCE)hsem ); } + +/* + * @implemented + */ +BOOL STDCALL +EngInitializeSafeSemaphore( + OUT ENGSAFESEMAPHORE *Semaphore) +{ + HSEMAPHORE hSem; + + if (InterlockedIncrement(&Semaphore->lCount) == 1) + { + /* Create the semaphore */ + hSem = EngCreateSemaphore(); + if (hSem == 0) + { + InterlockedDecrement(&Semaphore->lCount); + return FALSE; + } + InterlockedExchangePointer((volatile PVOID *)&Semaphore->hsem, hSem); + } + else + { + /* Wait for the other thread to create the semaphore */ + ASSERT(Semaphore->lCount > 1); + ASSERT_IRQL(PASSIVE_LEVEL); + while (Semaphore->hsem == NULL); + } + + return TRUE; +} + +/* + * @implemented + */ +VOID STDCALL +EngDeleteSafeSemaphore( + IN OUT ENGSAFESEMAPHORE *Semaphore) +{ + if (InterlockedDecrement(&Semaphore->lCount) == 0) + { + EngDeleteSemaphore(Semaphore->hsem); + InterlockedExchangePointer((volatile PVOID *)&Semaphore->hsem, NULL); + } +} + + _____ Added: trunk/reactos/subsys/win32k/eng/window.c --- trunk/reactos/subsys/win32k/eng/window.c 2005-01-06 22:22:13 UTC (rev 12856) +++ trunk/reactos/subsys/win32k/eng/window.c 2005-01-06 23:12:59 UTC (rev 12857) @@ -0,0 +1,200 @@ +/* + * ReactOS W32 Subsystem + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id: window.c,v 1.11 2004/05/10 17:07:17 blight Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: GDI WNDOBJ Functions + * FILE: subsys/win32k/eng/window.c + * PROGRAMER: Gregor Anich + * REVISION HISTORY: + * 16/11/2004: Created + */ +#include <w32k.h> + +/* + * Calls the WNDOBJCHANGEPROC of the given WNDOBJ + */ +VOID +FASTCALL +IntEngWndChanged( + IN WNDOBJ *pwo, + IN FLONG flChanged) +{ + WNDGDI *WndObjInt = ObjToGDI(pwo, WND); + + if (WndObjInt->ChangeProc == NULL) + { + return; + } + + /* check flags of the WNDOBJ */ + flChanged &= WndObjInt->Flags; + if (flChanged == 0) + { + return; + } + + /* Call the WNDOBJCHANGEPROC */ + if (flChanged == WOC_CHANGED) + { + pwo = NULL; + } + + DPRINT1("Calling WNDOBJCHANGEPROC (0x%x), Changed = 0x%x\n", + WndObjInt->ChangeProc, flChanged); + WndObjInt->ChangeProc(pwo, flChanged); +} + +/* + * @implemented + */ +WNDOBJ* +STDCALL +EngCreateWnd( + SURFOBJ *pso, + HWND hwnd, + WNDOBJCHANGEPROC pfn, + FLONG fl, + int iPixelFormat + ) +{ + WNDGDI *WndObjInt = NULL; + WNDOBJ *WndObjUser = NULL; + PWINDOW_OBJECT Window; + CLIPOBJ *ClientClipObj; + + DPRINT("EngCreateWnd: WNDOBJCHANGEPROC = 0x%x, Flags = 0x%x\n", pfn, fl); + + /* Get window object */ + Window = IntGetWindowObject(hwnd); + if (Window == NULL) + { + return NULL; + } + + /* Create WNDOBJ */ + WndObjInt = EngAllocMem(0, sizeof (WNDGDI), TAG_WNDOBJ); + if (WndObjInt == NULL) + { + IntReleaseWindowObject(Window); + DPRINT1("Failed to allocate memory for a WND structure!\n"); + return NULL; + } + + ClientClipObj = IntEngCreateClipRegion(1, (PRECTL)&Window->ClientRect, + (PRECTL)&Window->ClientRect); + if (ClientClipObj == NULL) + { + IntReleaseWindowObject(Window); + EngFreeMem(WndObjInt); + return NULL; + } + + /* fill user object */ + WndObjUser = GDIToObj(WndObjInt, WND); + WndObjUser->psoOwner = pso; + WndObjUser->pvConsumer = NULL; + RtlCopyMemory(&WndObjUser->rclClient, &Window->ClientRect, sizeof (RECT)); + RtlCopyMemory(&WndObjUser->coClient, ClientClipObj, sizeof (CLIPOBJ)); + + /* fill internal object */ + WndObjInt->ChangeProc = pfn; + WndObjInt->Flags = fl; + WndObjInt->PixelFormat = iPixelFormat; + WndObjInt->ClientClipObj = ClientClipObj; + + /* release resources */ + IntReleaseWindowObject(Window); + + /* HACKHACKHACK */ + IntEngWndChanged(WndObjUser, WOC_RGN_CLIENT); + + DPRINT("EngCreateWnd: SUCCESS!\n"); + return WndObjUser; +} + + +/* + * @implemented + */ +VOID +STDCALL +EngDeleteWnd ( IN WNDOBJ *pwo ) +{ + WNDGDI *WndObjInt = ObjToGDI(pwo, WND); + + DPRINT("EngDeleteWnd\n"); + + IntEngDeleteClipRegion(WndObjInt->ClientClipObj); + EngFreeMem(WndObjInt); +} + + +/* + * @implemented + */ +BOOL +STDCALL +WNDOBJ_bEnum( + IN WNDOBJ *pwo, + IN ULONG cj, + OUT ULONG *pul + ) +{ + WNDGDI *WndObjInt = ObjToGDI(pwo, WND); + DPRINT("WNDOBJ_bEnum\n"); + return CLIPOBJ_bEnum(WndObjInt->ClientClipObj, cj, pul); +} + + +/* + * @implemented + */ +ULONG +STDCALL +WNDOBJ_cEnumStart( + IN WNDOBJ *pwo, + IN ULONG iType, + IN ULONG iDirection, + IN ULONG cLimit + ) +{ + WNDGDI *WndObjInt = ObjToGDI(pwo, WND); + DPRINT("WNDOBJ_cEnumStart\n"); + /* FIXME: Should we enumerate all rectangles or not? */ + return CLIPOBJ_cEnumStart(WndObjInt->ClientClipObj, FALSE, iType, iDirection, cLimit); +} + + +/* + * @implemented + */ +VOID +STDCALL +WNDOBJ_vSetConsumer( + IN WNDOBJ *pwo, + IN PVOID pvConsumer + ) +{ + pwo->pvConsumer = pvConsumer; +} + +/* EOF */ + _____ Modified: trunk/reactos/subsys/win32k/include/inteng.h --- trunk/reactos/subsys/win32k/include/inteng.h 2005-01-06 22:22:13 UTC (rev 12856) +++ trunk/reactos/subsys/win32k/include/inteng.h 2005-01-06 23:12:59 UTC (rev 12857) @@ -22,6 +22,17 @@ /* Definitions of IntEngXxx functions */ +#define IntEngLockProcessDriverObjs(W32Process) \ + ExAcquireFastMutex(&(W32Process)->DriverObjListLock) + +#define IntEngUnLockProcessDriverObjs(W32Process) \ + ExReleaseFastMutex(&(W32Process)->DriverObjListLock) + +VOID FASTCALL +IntEngCleanupDriverObjs(struct _EPROCESS *Process, + PW32PROCESS Win32Process); + + BOOL STDCALL IntEngLineTo(BITMAPOBJ *Surface, CLIPOBJ *Clip, _____ Modified: trunk/reactos/subsys/win32k/include/menu.h --- trunk/reactos/subsys/win32k/include/menu.h 2005-01-06 22:22:13 UTC (rev 12856) +++ trunk/reactos/subsys/win32k/include/menu.h 2005-01-06 23:12:59 UTC (rev 12857) @@ -45,16 +45,16 @@ IntGetMenuObject(HMENU hMenu); #define IntLockMenuItems(MenuObj) \ - ExAcquireFastMutex(&MenuObj->MenuItemsLock) + ExAcquireFastMutex(&(MenuObj)->MenuItemsLock) #define IntUnLockMenuItems(MenuObj) \ - ExReleaseFastMutex(&MenuObj->MenuItemsLock) + ExReleaseFastMutex(&(MenuObj)->MenuItemsLock) #define IntLockProcessMenus(W32Process) \ - ExAcquireFastMutex(&W32Process->MenuListLock) + ExAcquireFastMutex(&(W32Process)->MenuListLock) #define IntUnLockProcessMenus(W32Process) \ - ExReleaseFastMutex(&W32Process->MenuListLock) + ExReleaseFastMutex(&(W32Process)->MenuListLock) #define IntReleaseMenuObject(MenuObj) \ ObmDereferenceObject(MenuObj) _____ Modified: trunk/reactos/subsys/win32k/include/tags.h --- trunk/reactos/subsys/win32k/include/tags.h 2005-01-06 22:22:13 UTC (rev 12856) +++ trunk/reactos/subsys/win32k/include/tags.h 2005-01-06 23:12:59 UTC (rev 12857) @@ -45,9 +45,11 @@ /* Eng objects */ #define TAG_CLIPOBJ TAG('C', 'L', 'P', 'O') /* clip object */ -#define TAG_XLATEOBJ TAG('X', 'L', 'A', 'O') /* xlate object */ +#define TAG_DRIVEROBJ TAG('D', 'R', 'V', 'O') /* driver object */ #define TAG_FONT TAG('F', 'N', 'T', 'E') /* font entry */ #define TAG_FONTOBJ TAG('F', 'N', 'T', 'O') /* font object */ +#define TAG_WNDOBJ TAG('W', 'N', 'D', 'O') /* window object */ +#define TAG_XLATEOBJ TAG('X', 'L', 'A', 'O') /* xlate object */ /* misc */ #define TAG_DRIVER TAG('G', 'D', 'R', 'V') /* video drivers */ _____ Modified: trunk/reactos/subsys/win32k/main/dllmain.c --- trunk/reactos/subsys/win32k/main/dllmain.c 2005-01-06 22:22:13 UTC (rev 12856) +++ trunk/reactos/subsys/win32k/main/dllmain.c 2005-01-06 23:12:59 UTC (rev 12857) @@ -1,6 +1,6 @@ /* * ReactOS W32 Subsystem - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 ReactOS Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,6 +71,9 @@ InitializeListHead(&Win32Process->PrivateFontListHead); ExInitializeFastMutex(&Win32Process->PrivateFontListLock); + InitializeListHead(&Win32Process->DriverObjListHead); + ExInitializeFastMutex(&Win32Process->DriverObjListLock); + Win32Process->KeyboardLayout = W32kGetDefaultKeyLayout(); /* setup process flags */ @@ -82,8 +85,10 @@ IntRemoveProcessWndProcHandles((HANDLE)Process->UniqueProcessId); IntCleanupMenus(Process, Win32Process); IntCleanupCurIcons(Process, Win32Process); + IntEngCleanupDriverObjs(Process, Win32Process); CleanupMonitorImpl(); + GDI_CleanupForProcess(Process); IntGraphicsCheck(FALSE); _____ Modified: trunk/reactos/subsys/win32k/makefile --- trunk/reactos/subsys/win32k/makefile 2005-01-06 22:22:13 UTC (rev 12856) +++ trunk/reactos/subsys/win32k/makefile 2005-01-06 23:12:59 UTC (rev 12857) @@ -55,7 +55,7 @@ eng/clip.o eng/copybits.o eng/device.o eng/lineto.o \ eng/paint.o eng/palette.o eng/perfcnt.o eng/semaphor.o eng/surface.o \ eng/xlate.o eng/transblt.o eng/mouse.o eng/misc.o eng/sort.o \ - eng/gradient.o eng/event.o eng/float.o + eng/gradient.o eng/event.o eng/float.o eng/driverobj.o eng/window.o MAIN_OBJECTS = main/dllmain.o main/svctabm.o _____ Modified: trunk/reactos/subsys/win32k/stubs/stubs.c --- trunk/reactos/subsys/win32k/stubs/stubs.c 2005-01-06 22:22:13 UTC (rev 12856) +++ trunk/reactos/subsys/win32k/stubs/stubs.c 2005-01-06 23:12:59 UTC (rev 12857) @@ -129,22 +129,6 @@ /* * @unimplemented */ -HDRVOBJ -STDCALL -EngCreateDriverObj( - PVOID pvObj, - FREEOBJPROC pFreeObjProc, - HDEV hdev - ) -{ - //
www.osr.com/ddk/graphics/gdifncs_8svb.htm
- UNIMPLEMENTED; - return NULL; -} - -/* - * @unimplemented - */ PATHOBJ* STDCALL EngCreatePath ( VOID ) @@ -157,40 +141,6 @@ /* * @unimplemented */ -WNDOBJ* -STDCALL -EngCreateWnd( - SURFOBJ *pso, - HWND hwnd, - WNDOBJCHANGEPROC pfn, - FLONG fl, - int iPixelFormat - ) -{ - //
www.osr.com/ddk/graphics/gdifncs_2ip3.htm
- UNIMPLEMENTED; - return NULL; -} - -/* - * @unimplemented - */ -BOOL -STDCALL -EngDeleteDriverObj( - IN HDRVOBJ hdo, - IN BOOL bCallBack, - IN BOOL bLocked - ) -{ - //
www.osr.com/ddk/graphics/gdifncs_0qlj.htm
- UNIMPLEMENTED; - return FALSE; -} - -/* - * @unimplemented - */ VOID STDCALL EngDeletePath ( IN PATHOBJ *ppo ) @@ -202,17 +152,6 @@ /* * @unimplemented */ -VOID -STDCALL -EngDeleteWnd ( IN WNDOBJ *pwo ) -{ - //
www.osr.com/ddk/graphics/gdifncs_2z3b.htm
- UNIMPLEMENTED; -} - -/* - * @unimplemented - */ BOOL STDCALL EngEnumForms ( @@ -425,18 +364,6 @@ /* * @unimplemented */ -DRIVEROBJ* -STDCALL -EngLockDriverObj ( IN HDRVOBJ hdo ) -{ - //
www.osr.com/ddk/graphics/gdifncs_41if.htm
- UNIMPLEMENTED; - return NULL; -} - -/* - * @unimplemented - */ PVOID STDCALL EngMapModule( @@ -575,15 +502,6 @@ UNIMPLEMENTED; } -BOOL -STDCALL -EngUnlockDriverObj ( IN HDRVOBJ hdo ) -{ - //
www.osr.com/ddk/graphics/gdifncs_0l5z.htm
- UNIMPLEMENTED; - return FALSE; -} - INT STDCALL EngWideCharToMultiByte( @@ -1110,44 +1028,6 @@ BOOL STDCALL -WNDOBJ_bEnum( - IN WNDOBJ *pwo, - IN ULONG cj, - OUT ULONG *pul - ) -{ - //
www.osr.com/ddk/graphics/gdifncs_3jqf.htm
- UNIMPLEMENTED; - return FALSE; -} - -ULONG -STDCALL -WNDOBJ_cEnumStart( - IN WNDOBJ *pwo, - IN ULONG iType, - IN ULONG iDirection, - IN ULONG cLimit - ) -{ - //
www.osr.com/ddk/graphics/gdifncs_18o7.htm
- UNIMPLEMENTED; - return 0; -} - -VOID -STDCALL -WNDOBJ_vSetConsumer( - IN WNDOBJ *pwo, - IN PVOID pvConsumer - ) -{ - //
www.osr.com/ddk/graphics/gdifncs_484n.htm
- UNIMPLEMENTED; -} - -BOOL -STDCALL XFORMOBJ_bApplyXform( IN XFORMOBJ *pxo, IN ULONG iMode, @@ -1270,6 +1150,19 @@ /* * @unimplemented */ +PVOID STDCALL +EngAllocPrivateUserMem( + IN PDD_SURFACE_LOCAL psl, + IN SIZE_T cj, + IN ULONG tag) +{ + UNIMPLEMENTED; + return NULL; +} + +/* + * @unimplemented + */ VOID STDCALL EngClearEvent( IN PEVENT Event) @@ -1292,8 +1185,9 @@ * @unimplemented */ VOID STDCALL -EngDeleteSafeSemaphore( - IN OUT ENGSAFESEMAPHORE *Semaphore) +EngFreePrivateUserMem( + IN PDD_SURFACE_LOCAL psl, + IN PVOID pv) { UNIMPLEMENTED; } @@ -1329,17 +1223,6 @@ /* * @unimplemented */ -BOOL STDCALL -EngInitializeSafeSemaphore( - OUT ENGSAFESEMAPHORE *Semaphore) -{ - UNIMPLEMENTED; - return FALSE; -} - -/* - * @unimplemented - */ PDD_SURFACE_LOCAL STDCALL EngLockDirectDrawSurface( IN HANDLE Surface) _____ Modified: trunk/reactos/subsys/win32k/win32k.def --- trunk/reactos/subsys/win32k/win32k.def 2005-01-06 22:22:13 UTC (rev 12856) +++ trunk/reactos/subsys/win32k/win32k.def 2005-01-06 23:12:59 UTC (rev 12857) @@ -15,6 +15,7 @@ EngAlphaBlend@28 EngAcquireSemaphore@4 EngAllocMem@12 +EngAllocPrivateUserMem@12 EngAllocUserMem@8 EngAssociateSurface@12 EngBitBlt@44 @@ -39,6 +40,7 @@ EngDeleteEvent@4 EngDeletePalette@4 EngDeletePath@4 +EngDeleteSafeSemaphore@4 EngDeleteSemaphore@4 EngDeleteSurface@4 EngDeleteWnd@4 @@ -51,6 +53,7 @@ EngFindResource@16 EngFreeMem@4 EngFreeModule@4 +EngFreePrivateUserMem@8 EngFreeUserMem@4 EngGetCurrentCodePage(a)8=ntoskrnl.RtlGetCurrentCodePage EngGetCurrentProcessId@0 @@ -66,6 +69,7 @@ EngGetProcessHandle@0 EngGetType1FontList@24 EngGradientFill@40 +EngInitializeSafeSemaphore@4 EngLineTo@36 EngLoadImage@4 EngLoadModule@4
19 years, 11 months
1
0
0
0
[chorns] 12856: * Generate kernel
by chorns@svn.reactos.com
* Generate kernel * Add static library module type * Add build script for kjs Modified: branches/xmlbuildsystem/reactos/ReactOS.xml Added: branches/xmlbuildsystem/reactos/lib/directory.xml Added: branches/xmlbuildsystem/reactos/lib/kjs/module.xml Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h _____ Modified: branches/xmlbuildsystem/reactos/ReactOS.xml --- branches/xmlbuildsystem/reactos/ReactOS.xml 2005-01-06 20:38:14 UTC (rev 12855) +++ branches/xmlbuildsystem/reactos/ReactOS.xml 2005-01-06 22:22:13 UTC (rev 12856) @@ -4,6 +4,9 @@ <file>depends.c</file> </module> </directory> + <directory name="lib"> + <xi:include href="lib/directory.xml" /> + </directory> <directory name="ntoskrnl"> <xi:include href="ntoskrnl/module.xml" /> </directory> _____ Added: branches/xmlbuildsystem/reactos/lib/directory.xml --- branches/xmlbuildsystem/reactos/lib/directory.xml 2005-01-06 20:38:14 UTC (rev 12855) +++ branches/xmlbuildsystem/reactos/lib/directory.xml 2005-01-06 22:22:13 UTC (rev 12856) @@ -0,0 +1,3 @@ +<directory name="kjs"> + <xi:include href="kjs/module.xml" /> +</directory> _____ Added: branches/xmlbuildsystem/reactos/lib/kjs/module.xml --- branches/xmlbuildsystem/reactos/lib/kjs/module.xml 2005-01-06 20:38:14 UTC (rev 12855) +++ branches/xmlbuildsystem/reactos/lib/kjs/module.xml 2005-01-06 22:22:13 UTC (rev 12856) @@ -0,0 +1,42 @@ +<module name="kjs" type="staticlibrary"> + <include>.</include> + <include>./src</include> + <include>./include</include> + <directory name="ksrc"> + <file>setjmp.S</file> + <file>longjmp.S</file> + <file>alloc.c</file> + <file>bc.c</file> + <file>b_core.c</file> + <file>b_file.c</file> + <file>b_func.c</file> + <file>b_regexp.c</file> + <file>b_system.c</file> + <file>compat.c</file> + <file>debug.c</file> + <file>iostream.c</file> + <file>js.c</file> + <file>kjs.c</file> + <file>mrgsort.c</file> + <file>object.c</file> + <file>regex.c</file> + <file>vm.c</file> + <file>vmjumps.c</file> + <file>vmswitch.c</file> + <file>vmswt0.c</file> + <file>longjmp.c</file> + </directory> + <directory name="src"> + <file>b_array.c</file> + <file>b_bool.c</file> + <file>b_object.c</file> + <file>b_number.c</file> + <file>b_string.c</file> + <file>b_vm.c</file> + <file>compiler.c</file> + <file>crc32.c</file> + <file>dl_dummy.c</file> + <file>heap.c</file> + <file>utils.c</file> + </directory> +</module> _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-06 20:38:14 UTC (rev 12855) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-06 22:22:13 UTC (rev 12856) @@ -61,9 +61,11 @@ void MingwBackend::GenerateGlobalVariables () { + fprintf ( fMakefile, "rm = del /y\n" ); fprintf ( fMakefile, "gcc = gcc\n" ); fprintf ( fMakefile, "ld = ld\n" ); fprintf ( fMakefile, "ar = ar\n" ); + fprintf ( fMakefile, "dlltool = dlltool\n" ); fprintf ( fMakefile, "\n" ); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-06 20:38:14 UTC (rev 12855) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-06 22:22:13 UTC (rev 12856) @@ -13,6 +13,12 @@ } string +MingwModuleHandler::GetWorkingDirectory () +{ + return "."; +} + +string MingwModuleHandler::ReplaceExtension ( string filename, string newExtension ) { @@ -30,7 +36,7 @@ } string -MingwModuleHandler::GetModuleLibraryDependencies ( Module& module ) +MingwModuleHandler::GetImportLibraryDependencies ( Module& module ) { if ( module.libraries.size () == 0 ) return ""; @@ -40,7 +46,9 @@ { if ( dependencies.size () > 0 ) dependencies += " "; - dependencies += module.libraries[i]->name; + Module* importedModule = module.project->LocateModule ( module.libraries[i]->name ); + assert ( importedModule != NULL ); + dependencies += importedModule->GetPath ().c_str (); } return dependencies; } @@ -96,8 +104,8 @@ string objectFilename = GetObjectFilename ( sourceFilename ); fprintf ( fMakefile, "%s: %s\n", - sourceFilename.c_str (), - objectFilename.c_str() ); + objectFilename.c_str (), + sourceFilename.c_str() ); fprintf ( fMakefile, "\t${gcc} -c %s -o %s\n", sourceFilename.c_str (), @@ -146,10 +154,40 @@ void MingwKernelModuleHandler::GenerateKernelModuleTarget ( Module& module ) { - fprintf ( fMakefile, "%s: %s\n", + string workingDirectory = GetWorkingDirectory ( ); + string archiveFilename = GetModuleArchiveFilename ( module ); + string importLibraryDependencies = GetImportLibraryDependencies ( module ); + fprintf ( fMakefile, "%s: %s %s\n", module.GetPath ().c_str (), - GetModuleLibraryDependencies ( module ).c_str () ); - fprintf ( fMakefile, "\t\n\n" ); + archiveFilename.c_str (), + importLibraryDependencies.c_str () ); + fprintf ( fMakefile, + "\t${gcc} -Wl,--base-file,%s/base.tmp -o %s/junk.tmp %s %s\n", + workingDirectory.c_str (), + workingDirectory.c_str (), + archiveFilename.c_str (), + importLibraryDependencies.c_str () ); + fprintf ( fMakefile, + "\t${rm} %s/junk.tmp\n", + workingDirectory.c_str () ); + fprintf ( fMakefile, + "\t${dlltool} --dllname %s --base-file %s/base.tmp --output-exp %s/temp.exp --kill-at\n", + module.GetPath ().c_str (), + workingDirectory.c_str (), + workingDirectory.c_str ()); + fprintf ( fMakefile, + "\t${rm} %s/base.tmp\n", + workingDirectory.c_str () ); + fprintf ( fMakefile, + "\t${ld} -Wl,%s/temp.exp -o %s %s %s\n", + workingDirectory.c_str (), + module.GetPath ().c_str (), + archiveFilename.c_str (), + importLibraryDependencies.c_str () ); + fprintf ( fMakefile, + "\t${rm} %s/temp.exp\n", + workingDirectory.c_str () ); + GenerateArchiveTarget ( module ); GenerateObjectFileTargets ( module ); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-06 20:38:14 UTC (rev 12855) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-06 22:22:13 UTC (rev 12856) @@ -10,10 +10,11 @@ virtual bool CanHandleModule ( Module& module ) = 0; virtual void Process ( Module& module ) = 0; protected: + std::string MingwModuleHandler::GetWorkingDirectory (); std::string ReplaceExtension ( std::string filename, std::string newExtension ); std::string GetModuleArchiveFilename ( Module& module ); - std::string GetModuleLibraryDependencies ( Module& module ); + std::string GetImportLibraryDependencies ( Module& module ); std::string GetSourceFilenames ( Module& module ); std::string GetObjectFilename ( std::string sourceFilename ); std::string GetObjectFilenames ( Module& module ); _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-06 20:38:14 UTC (rev 12855) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-06 22:22:13 UTC (rev 12856) @@ -40,10 +40,12 @@ } #endif -Module::Module ( const XMLElement& moduleNode, +Module::Module ( Project* project, + const XMLElement& moduleNode, const string& moduleName, const string& modulePath ) - : node(moduleNode), + : project(project), + node(moduleNode), name(moduleName), path(modulePath) { @@ -87,6 +89,8 @@ { if ( attribute.value == "buildtool" ) return BuildTool; + if ( attribute.value == "staticlibrary" ) + return StaticLibrary; if ( attribute.value == "kernelmodedll" ) return KernelModeDLL; throw InvalidAttributeValueException ( attribute.name, _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-06 20:38:14 UTC (rev 12855) +++ branches/xmlbuildsystem/reactos/tools/rbuild/project.cpp 2005-01-06 22:22:13 UTC (rev 12856) @@ -64,7 +64,7 @@ { att = e.GetAttribute ( "name", true ); assert(att); - Module* module = new Module ( e, att->value, path ); + Module* module = new Module ( this, e, att->value, path ); modules.push_back ( module ); module->ProcessXML ( e, path ); return; @@ -78,3 +78,15 @@ for ( size_t i = 0; i < e.subElements.size (); i++ ) ProcessXML ( *e.subElements[i], subpath ); } + +Module* +Project::LocateModule ( string name ) +{ + for ( size_t i = 0; i < modules.size (); i++ ) + { + if (modules[i]->name == name) + return modules[i]; + } + + return NULL; +} _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-06 20:38:14 UTC (rev 12855) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-06 22:22:13 UTC (rev 12856) @@ -24,6 +24,7 @@ ~Project (); void ProcessXML ( const XMLElement& e, const std::string& path ); + Module* LocateModule ( std::string name ); private: void ReadXml (); XMLFile xmlfile; @@ -34,12 +35,14 @@ enum ModuleType { BuildTool, + StaticLibrary, KernelModeDLL }; class Module { public: + Project* project; const XMLElement& node; std::string name; std::string path; @@ -47,7 +50,8 @@ std::vector<File*> files; std::vector<Library*> libraries; - Module ( const XMLElement& moduleNode, + Module ( Project* project, + const XMLElement& moduleNode, const std::string& moduleName, const std::string& modulePath ); ~Module();
19 years, 11 months
1
0
0
0
[chorns] 12855: Generate dependencies for kernel module type.
by chorns@svn.reactos.com
Generate dependencies for kernel module type. Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-06 19:22:01 UTC (rev 12854) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-06 20:38:14 UTC (rev 12855) @@ -16,37 +16,6 @@ } } factory; -#ifdef WIN32 -#define EXEPOSTFIX ".exe" -#define SEP "\\" -string -FixSep ( const string& s ) -{ - string s2(s); - char* p = strchr ( &s2[0], '/' ); - while ( p ) - { - *p++ = '\\'; - p = strchr ( p, '/' ); - } - return s2; -} -#else -#define EXEPOSTFIX -#define SEP "/" -string -FixSep ( const string& s ) -{ - string s2(s); - char* p = strchr ( &s2[0], '\\' ); - while ( p ) - { - *p++ = '/'; - p = strchr ( p, '\\' ); - } - return s2; -} -#endif MingwBackend::MingwBackend ( Project& project ) : Backend ( project ) @@ -58,6 +27,7 @@ { CreateMakefile (); GenerateHeader (); + GenerateGlobalVariables (); GenerateAllTarget (); for ( size_t i = 0; i < ProjectNode.modules.size (); i++ ) { @@ -89,18 +59,26 @@ } void +MingwBackend::GenerateGlobalVariables () +{ + fprintf ( fMakefile, "gcc = gcc\n" ); + fprintf ( fMakefile, "ld = ld\n" ); + fprintf ( fMakefile, "ar = ar\n" ); + fprintf ( fMakefile, "\n" ); +} + +void MingwBackend::GenerateAllTarget () { - fprintf ( fMakefile, "all: " ); + fprintf ( fMakefile, "all:" ); for ( size_t i = 0; i < ProjectNode.modules.size (); i++ ) { Module& module = *ProjectNode.modules[i]; fprintf ( fMakefile, - " %s" SEP "%s" EXEPOSTFIX, - FixSep(module.path).c_str (), - module.name.c_str () ); + " %s", + module.GetPath ().c_str () ); } - fprintf ( fMakefile, "\n\n" ); + fprintf ( fMakefile, "\n\t\n\n" ); } void _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h 2005-01-06 19:22:01 UTC (rev 12854) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h 2005-01-06 20:38:14 UTC (rev 12855) @@ -28,6 +28,7 @@ void CreateMakefile (); void CloseMakefile (); void GenerateHeader (); + void GenerateGlobalVariables (); void GenerateAllTarget (); FILE* fMakefile; }; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-06 19:22:01 UTC (rev 12854) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-01-06 20:38:14 UTC (rev 12855) @@ -13,21 +13,119 @@ } string -MingwModuleHandler::GetModuleDependencies ( Module& module ) +MingwModuleHandler::ReplaceExtension ( string filename, + string newExtension ) { - if ( !module.libraries.size() ) - return ""; + size_t index = filename.find_last_of ( '.' ); + if (index != string::npos) + return filename.substr ( 0, index ) + newExtension; + return filename; +} - string dependencies ( module.libraries[0]->name ); +string +MingwModuleHandler::GetModuleArchiveFilename ( Module& module ) +{ + return ReplaceExtension ( module.GetPath ().c_str (), + ".a" ); +} - for ( size_t i = 1; i < module.libraries.size(); i++ ) +string +MingwModuleHandler::GetModuleLibraryDependencies ( Module& module ) +{ + if ( module.libraries.size () == 0 ) + return ""; + + string dependencies ( "" ); + for ( size_t i = 0; i < module.libraries.size (); i++ ) { - dependencies += " " + module.libraries[i]->name; + if ( dependencies.size () > 0 ) + dependencies += " "; + dependencies += module.libraries[i]->name; } return dependencies; } +string +MingwModuleHandler::GetSourceFilenames ( Module& module ) +{ + if ( module.files.size () == 0 ) + return ""; + + string sourceFilenames ( "" ); + for ( size_t i = 0; i < module.files.size (); i++ ) + { + if ( sourceFilenames.size () > 0 ) + sourceFilenames += " "; + sourceFilenames += module.files[i]->name; + } + return sourceFilenames; +} +string +MingwModuleHandler::GetObjectFilename ( string sourceFilename ) +{ + return ReplaceExtension ( sourceFilename, + ".o" ); +} + +string +MingwModuleHandler::GetObjectFilenames ( Module& module ) +{ + if ( module.files.size () == 0 ) + return ""; + + string objectFilenames ( "" ); + for ( size_t i = 0; i < module.files.size (); i++ ) + { + if ( objectFilenames.size () > 0 ) + objectFilenames += " "; + objectFilenames += GetObjectFilename ( module.files[i]->name ); + } + return objectFilenames; +} + +void +MingwModuleHandler::GenerateObjectFileTargets ( Module& module ) +{ + if ( module.files.size () == 0 ) + return; + + for ( size_t i = 0; i < module.files.size (); i++ ) + { + string sourceFilename = module.files[i]->name; + string objectFilename = GetObjectFilename ( sourceFilename ); + fprintf ( fMakefile, + "%s: %s\n", + sourceFilename.c_str (), + objectFilename.c_str() ); + fprintf ( fMakefile, + "\t${gcc} -c %s -o %s\n", + sourceFilename.c_str (), + objectFilename.c_str () ); + } + + fprintf ( fMakefile, "\n" ); +} + +void +MingwModuleHandler::GenerateArchiveTarget ( Module& module ) +{ + string archiveFilename = GetModuleArchiveFilename ( module ); + string sourceFilenames = GetSourceFilenames ( module ); + string objectFilenames = GetObjectFilenames ( module ); + + fprintf ( fMakefile, + "%s: %s\n", + archiveFilename.c_str (), + sourceFilenames.c_str ()); + + fprintf ( fMakefile, + "\t${ar} -rc %s %s\n\n", + archiveFilename.c_str (), + objectFilenames.c_str ()); +} + + MingwKernelModuleHandler::MingwKernelModuleHandler ( FILE* fMakefile ) : MingwModuleHandler ( fMakefile ) { @@ -48,10 +146,10 @@ void MingwKernelModuleHandler::GenerateKernelModuleTarget ( Module& module ) { - fprintf ( fMakefile, "%s: %s", - module.name.c_str (), - GetModuleDependencies ( module ).c_str () ); - fprintf ( fMakefile, "\n" ); - fprintf ( fMakefile, "\t" ); - fprintf ( fMakefile, "\n\n" ); + fprintf ( fMakefile, "%s: %s\n", + module.GetPath ().c_str (), + GetModuleLibraryDependencies ( module ).c_str () ); + fprintf ( fMakefile, "\t\n\n" ); + GenerateArchiveTarget ( module ); + GenerateObjectFileTargets ( module ); } _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-06 19:22:01 UTC (rev 12854) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-01-06 20:38:14 UTC (rev 12855) @@ -10,8 +10,16 @@ virtual bool CanHandleModule ( Module& module ) = 0; virtual void Process ( Module& module ) = 0; protected: + std::string ReplaceExtension ( std::string filename, + std::string newExtension ); + std::string GetModuleArchiveFilename ( Module& module ); + std::string GetModuleLibraryDependencies ( Module& module ); + std::string GetSourceFilenames ( Module& module ); + std::string GetObjectFilename ( std::string sourceFilename ); + std::string GetObjectFilenames ( Module& module ); + void GenerateObjectFileTargets ( Module& module ); + void GenerateArchiveTarget ( Module& module ); FILE* fMakefile; - std::string GetModuleDependencies ( Module& module ); }; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-06 19:22:01 UTC (rev 12854) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-06 20:38:14 UTC (rev 12855) @@ -8,9 +8,41 @@ using std::string; using std::vector; +#ifdef WIN32 +#define EXEPOSTFIX ".exe" +#define SEP "\\" +string +FixSeparator ( const string& s ) +{ + string s2(s); + char* p = strchr ( &s2[0], '/' ); + while ( p ) + { + *p++ = '\\'; + p = strchr ( p, '/' ); + } + return s2; +} +#else +#define EXEPOSTFIX +#define SEP "/" +string +FixSeparator ( const string& s ) +{ + string s2(s); + char* p = strchr ( &s2[0], '\\' ); + while ( p ) + { + *p++ = '/'; + p = strchr ( p, '\\' ); + } + return s2; +} +#endif + Module::Module ( const XMLElement& moduleNode, const string& moduleName, - const string& modulePath) + const string& modulePath ) : node(moduleNode), name(moduleName), path(modulePath) @@ -61,7 +93,13 @@ attribute.value ); } +string +Module::GetPath () +{ + return FixSeparator (path) + SEP + name + EXEPOSTFIX; +} + File::File ( const string& _name ) : name(_name) { _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-06 19:22:01 UTC (rev 12854) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-01-06 20:38:14 UTC (rev 12855) @@ -50,10 +50,9 @@ Module ( const XMLElement& moduleNode, const std::string& moduleName, const std::string& modulePath ); - ModuleType GetModuleType (const XMLAttribute& attribute ); - ~Module(); - + ModuleType GetModuleType (const XMLAttribute& attribute ); + std::string GetPath (); void ProcessXML ( const XMLElement& e, const std::string& path ); };
19 years, 11 months
1
0
0
0
← Newer
1
...
49
50
51
52
53
54
55
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200