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
February 2010
----- 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
22 participants
365 discussions
Start a n
N
ew thread
[ekohl] 45401: - Implement GetEventLogInformation. - OpenBackupEventLogA, OpenEventLogA, RegisterEventSourceA and ReportEventA: Call the ANSI RPC-Server Function directly instead of converting arguments to Unicode and calling the matching Unicode Function. - OpenEventLogW: Fix argument checks.
by ekohl@svn.reactos.org
Author: ekohl Date: Wed Feb 3 21:46:21 2010 New Revision: 45401 URL:
http://svn.reactos.org/svn/reactos?rev=45401&view=rev
Log: - Implement GetEventLogInformation. - OpenBackupEventLogA, OpenEventLogA, RegisterEventSourceA and ReportEventA: Call the ANSI RPC-Server Function directly instead of converting arguments to Unicode and calling the matching Unicode Function. - OpenEventLogW: Fix argument checks. Modified: trunk/reactos/dll/win32/advapi32/service/eventlog.c Modified: trunk/reactos/dll/win32/advapi32/service/eventlog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
============================================================================== --- trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/service/eventlog.c [iso-8859-1] Wed Feb 3 21:46:21 2010 @@ -26,20 +26,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(advapi); -static RPC_UNICODE_STRING EmptyString = { 0, 0, L"" }; - -static inline LPWSTR SERV_dup( LPCSTR str ) -{ - UINT len; - LPWSTR wstr; - - if( !str ) - return NULL; - len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 ); - wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof (WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, str, -1, wstr, len ); - return wstr; -} +static RPC_UNICODE_STRING EmptyStringU = { 0, 0, L"" }; +static RPC_STRING EmptyStringA = { 0, 0, "" }; + handle_t __RPC_USER EVENTLOG_HANDLE_A_bind(EVENTLOG_HANDLE_A UNCServerName) @@ -166,7 +155,7 @@ BackupFileName.Buffer = (LPSTR)lpBackupFileName; BackupFileName.Length = BackupFileName.MaximumLength = lpBackupFileName ? strlen(lpBackupFileName) : 0; - BackupFileName.MaximumLength += sizeof(CHAR); + BackupFileName.MaximumLength += sizeof(CHAR); RpcTryExcept { @@ -389,9 +378,29 @@ IN DWORD cbBufSize, OUT LPDWORD pcbBytesNeeded) { - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + NTSTATUS Status; + + RpcTryExcept + { + Status = ElfrGetLogInformation(hEventLog, + dwInfoLevel, + (LPBYTE)lpBuffer, + cbBufSize, + pcbBytesNeeded); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + if (!NT_SUCCESS(Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + + return TRUE; } @@ -416,7 +425,7 @@ SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - + RpcTryExcept { Status = ElfrNumberOfRecords(hEventLog, @@ -461,7 +470,7 @@ SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - + RpcTryExcept { Status = ElfrOldestRecord(hEventLog, @@ -510,32 +519,35 @@ OpenBackupEventLogA(IN LPCSTR lpUNCServerName, IN LPCSTR lpFileName) { - UNICODE_STRING UNCServerName; - UNICODE_STRING FileName; - HANDLE Handle; + ANSI_STRING FileName; + IELF_HANDLE LogHandle; + NTSTATUS Status; TRACE("%s, %s\n", lpUNCServerName, lpFileName); - if (!RtlCreateUnicodeStringFromAsciiz(&UNCServerName, lpUNCServerName)) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); + RtlInitAnsiString(&FileName, lpFileName); + + RpcTryExcept + { + Status = ElfrOpenBELA((LPSTR)lpUNCServerName, + (PRPC_STRING)&FileName, + 1, + 1, + &LogHandle); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + if (!NT_SUCCESS(Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); return NULL; } - if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName)) - { - RtlFreeUnicodeString(&UNCServerName); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return NULL; - } - - Handle = OpenBackupEventLogW(UNCServerName.Buffer, - FileName.Buffer); - - RtlFreeUnicodeString(&UNCServerName); - RtlFreeUnicodeString(&FileName); - - return Handle; + return (HANDLE)LogHandle; } @@ -600,19 +612,51 @@ * Failure: NULL */ HANDLE WINAPI -OpenEventLogA(IN LPCSTR uncname, - IN LPCSTR source) -{ - LPWSTR uncnameW, sourceW; - HANDLE handle; - - uncnameW = SERV_dup(uncname); - sourceW = SERV_dup(source); - handle = OpenEventLogW(uncnameW, sourceW); - HeapFree(GetProcessHeap(), 0, uncnameW); - HeapFree(GetProcessHeap(), 0, sourceW); - - return handle; +OpenEventLogA(IN LPCSTR lpUNCServerName, + IN LPCSTR lpSourceName) +{ + LPSTR UNCServerName; + ANSI_STRING SourceName; + IELF_HANDLE LogHandle = NULL; + NTSTATUS Status; + + TRACE("%s, %s\n", lpUNCServerName, lpSourceName); + + if (lpSourceName == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + + if (lpUNCServerName == NULL || *lpUNCServerName == 0) + UNCServerName = NULL; + else + UNCServerName = (LPSTR)lpUNCServerName; + + RtlInitAnsiString(&SourceName, lpSourceName); + + RpcTryExcept + { + Status = ElfrOpenELA(UNCServerName, + (PRPC_STRING)&SourceName, + &EmptyStringA, + 1, + 1, + &LogHandle); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + if (!NT_SUCCESS(Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); + return NULL; + } + + return (HANDLE)LogHandle; } @@ -627,22 +671,31 @@ OpenEventLogW(IN LPCWSTR lpUNCServerName, IN LPCWSTR lpSourceName) { - RPC_UNICODE_STRING SourceName; + LPWSTR UNCServerName; + UNICODE_STRING SourceName; IELF_HANDLE LogHandle; NTSTATUS Status; TRACE("%s, %s\n", debugstr_w(lpUNCServerName), debugstr_w(lpSourceName)); - SourceName.Buffer = (LPWSTR)lpSourceName; - SourceName.Length = SourceName.MaximumLength = - lpSourceName ? wcslen(lpSourceName) * sizeof(WCHAR) : 0; - SourceName.MaximumLength += sizeof(WCHAR); - - RpcTryExcept - { - Status = ElfrOpenELW((LPWSTR)lpUNCServerName, - &SourceName, - &EmptyString, + if (lpSourceName == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + + if (lpUNCServerName == NULL || *lpUNCServerName == 0) + UNCServerName = NULL; + else + UNCServerName = (LPWSTR)lpUNCServerName; + + RtlInitUnicodeString(&SourceName, lpSourceName); + + RpcTryExcept + { + Status = ElfrOpenELW(UNCServerName, + (PRPC_UNICODE_STRING)&SourceName, + &EmptyStringU, 1, 1, &LogHandle); @@ -801,32 +854,36 @@ RegisterEventSourceA(IN LPCSTR lpUNCServerName, IN LPCSTR lpSourceName) { - UNICODE_STRING UNCServerName; - UNICODE_STRING SourceName; - HANDLE Handle; + ANSI_STRING SourceName; + IELF_HANDLE LogHandle; + NTSTATUS Status; TRACE("%s, %s\n", lpUNCServerName, lpSourceName); - if (!RtlCreateUnicodeStringFromAsciiz(&UNCServerName, lpUNCServerName)) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); + RtlInitAnsiString(&SourceName, lpSourceName); + + RpcTryExcept + { + Status = ElfrRegisterEventSourceA((LPSTR)lpUNCServerName, + (PRPC_STRING)&SourceName, + &EmptyStringA, + 1, + 1, + &LogHandle); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + if (!NT_SUCCESS(Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); return NULL; } - if (!RtlCreateUnicodeStringFromAsciiz(&SourceName, lpSourceName)) - { - RtlFreeUnicodeString(&UNCServerName); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return NULL; - } - - Handle = RegisterEventSourceW(UNCServerName.Buffer, - SourceName.Buffer); - - RtlFreeUnicodeString(&UNCServerName); - RtlFreeUnicodeString(&SourceName); - - return Handle; + return (HANDLE)LogHandle; } @@ -861,7 +918,7 @@ { Status = ElfrRegisterEventSourceW((LPWSTR)lpUNCServerName, &SourceName, - &EmptyString, + &EmptyStringU, 1, 1, &LogHandle); @@ -896,61 +953,62 @@ IN LPCSTR *lpStrings, IN LPVOID lpRawData) { - LPCWSTR *wideStrArray; - UNICODE_STRING str; + NTSTATUS Status; + ANSI_STRING *Strings; + ANSI_STRING ComputerName; WORD i; - BOOL ret; - - if (wNumStrings == 0) - return TRUE; - - if (lpStrings == NULL) - return TRUE; - - wideStrArray = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - sizeof(LPCWSTR) * wNumStrings); + + TRACE("%p, %u, %u, %lu, %p, %u, %lu, %p, %p\n", + hEventLog, wType, wCategory, dwEventID, lpUserSid, + wNumStrings, dwDataSize, lpStrings, lpRawData); + + Strings = HeapAlloc(GetProcessHeap(), + 0, + wNumStrings * sizeof(ANSI_STRING)); + if (!Strings) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } for (i = 0; i < wNumStrings; i++) - { - if (!RtlCreateUnicodeStringFromAsciiz(&str, (PSTR)lpStrings[i])) - break; - wideStrArray[i] = str.Buffer; - } - - if (i == wNumStrings) - { - ret = ReportEventW(hEventLog, - wType, - wCategory, - dwEventID, - lpUserSid, - wNumStrings, - dwDataSize, - wideStrArray, - lpRawData); - } - else - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - ret = FALSE; - } - - for (i = 0; i < wNumStrings; i++) - { - if (wideStrArray[i]) - { - HeapFree(GetProcessHeap(), - 0, - (PVOID)wideStrArray[i]); - } - } - - HeapFree(GetProcessHeap(), - 0, - (PVOID)wideStrArray); - - return ret; + RtlInitAnsiString(&Strings[i], lpStrings[i]); + + /*FIXME: ComputerName */ + RtlInitAnsiString(&ComputerName, ""); + + RpcTryExcept + { + Status = ElfrReportEventA(hEventLog, + 0, /* FIXME: Time */ + wType, + wCategory, + dwEventID, + wNumStrings, + dwDataSize, + (PRPC_STRING) &ComputerName, + lpUserSid, + (PRPC_STRING*) &Strings, + lpRawData, + 0, + NULL, + NULL); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + Status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + HeapFree(GetProcessHeap(), 0, Strings); + + if (!NT_SUCCESS(Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + + return TRUE; }
14 years, 10 months
1
0
0
0
[cgutman] 45400: [AFD] - Add more cases to TdiAddressSizeFromType - Return STATUS_INVALID_PARAMETER instead of bugchecking if somebody gives us a bad address type - Fixes Steam (confirmed by Geoz) - Will also be merged to trunk soon
by cgutman@svn.reactos.org
Author: cgutman Date: Wed Feb 3 21:02:39 2010 New Revision: 45400 URL:
http://svn.reactos.org/svn/reactos?rev=45400&view=rev
Log: [AFD] - Add more cases to TdiAddressSizeFromType - Return STATUS_INVALID_PARAMETER instead of bugchecking if somebody gives us a bad address type - Fixes Steam (confirmed by Geoz) - Will also be merged to trunk soon Modified: branches/aicom-network-branch/drivers/network/afd/afd/bind.c branches/aicom-network-branch/drivers/network/afd/afd/connect.c branches/aicom-network-branch/drivers/network/afd/afd/listen.c branches/aicom-network-branch/drivers/network/afd/afd/main.c branches/aicom-network-branch/drivers/network/afd/afd/tdiconn.c branches/aicom-network-branch/drivers/network/afd/afd/write.c Modified: branches/aicom-network-branch/drivers/network/afd/afd/bind.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-branch/drivers/ne…
============================================================================== --- branches/aicom-network-branch/drivers/network/afd/afd/bind.c [iso-8859-1] (original) +++ branches/aicom-network-branch/drivers/network/afd/afd/bind.c [iso-8859-1] Wed Feb 3 21:02:39 2010 @@ -71,14 +71,15 @@ FCB->LocalAddress = TaCopyTransportAddress( &BindReq->Address ); if( FCB->LocalAddress ) - TdiBuildConnectionInfo( &FCB->AddressFrom, - FCB->LocalAddress ); + Status = TdiBuildConnectionInfo( &FCB->AddressFrom, + FCB->LocalAddress ); - if( FCB->AddressFrom ) + if( NT_SUCCESS(Status) ) Status = WarmSocketForBind( FCB ); - else return UnlockAndMaybeComplete(FCB, STATUS_NO_MEMORY, Irp, 0); + AFD_DbgPrint(MID_TRACE,("FCB->Flags %x\n", FCB->Flags)); - AFD_DbgPrint(MID_TRACE,("FCB->Flags %x\n", FCB->Flags)); + if( !NT_SUCCESS(Status) ) + return UnlockAndMaybeComplete(FCB, Status, Irp, 0); if( FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS ) { AFD_DbgPrint(MID_TRACE,("Calling TdiReceiveDatagram\n")); Modified: branches/aicom-network-branch/drivers/network/afd/afd/connect.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-branch/drivers/ne…
============================================================================== --- branches/aicom-network-branch/drivers/network/afd/afd/connect.c [iso-8859-1] (original) +++ branches/aicom-network-branch/drivers/network/afd/afd/connect.c [iso-8859-1] Wed Feb 3 21:02:39 2010 @@ -423,16 +423,17 @@ if( !NT_SUCCESS(Status) ) break; - TdiBuildConnectionInfo + Status = TdiBuildConnectionInfo ( &FCB->ConnectInfo, &ConnectReq->RemoteAddress ); - if( FCB->ConnectInfo ) - TdiBuildConnectionInfo(&TargetAddress, - &ConnectReq->RemoteAddress); - - - if( TargetAddress ) { + if( NT_SUCCESS(Status) ) + Status = TdiBuildConnectionInfo(&TargetAddress, + &ConnectReq->RemoteAddress); + else break; + + + if( NT_SUCCESS(Status) ) { TargetAddress->UserData = FCB->ConnectData; TargetAddress->UserDataLength = FCB->ConnectDataSize; TargetAddress->Options = FCB->ConnectOptions; @@ -454,7 +455,7 @@ FCB->State = SOCKET_STATE_CONNECTING; return LeaveIrpUntilLater( FCB, Irp, FUNCTION_CONNECT ); } - } else Status = STATUS_NO_MEMORY; + } break; default: Modified: branches/aicom-network-branch/drivers/network/afd/afd/listen.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-branch/drivers/ne…
============================================================================== --- branches/aicom-network-branch/drivers/network/afd/afd/listen.c [iso-8859-1] (original) +++ branches/aicom-network-branch/drivers/network/afd/afd/listen.c [iso-8859-1] Wed Feb 3 21:02:39 2010 @@ -156,13 +156,13 @@ FCB->ListenIrp. ConnectionReturnInfo->RemoteAddress)); - TdiBuildNullConnectionInfo( &Qelt->ConnInfo, AddressType ); - if( Qelt->ConnInfo ) { + Status = TdiBuildNullConnectionInfo( &Qelt->ConnInfo, AddressType ); + if( NT_SUCCESS(Status) ) { TaCopyTransportAddressInPlace ( Qelt->ConnInfo->RemoteAddress, FCB->ListenIrp.ConnectionReturnInfo->RemoteAddress ); InsertTailList( &FCB->PendingConnections, &Qelt->ListEntry ); - } else Status = STATUS_NO_MEMORY; + } } /* Satisfy a pre-accept request if one is available */ @@ -235,28 +235,21 @@ if( !NT_SUCCESS(Status) ) return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); - TdiBuildNullConnectionInfo + Status = TdiBuildNullConnectionInfo ( &FCB->ListenIrp.ConnectionCallInfo, FCB->LocalAddress->Address[0].AddressType ); - TdiBuildNullConnectionInfo + + if (!NT_SUCCESS(Status)) return UnlockAndMaybeComplete(FCB, Status, Irp, 0); + + Status = TdiBuildNullConnectionInfo ( &FCB->ListenIrp.ConnectionReturnInfo, FCB->LocalAddress->Address[0].AddressType ); - if( !FCB->ListenIrp.ConnectionReturnInfo || !FCB->ListenIrp.ConnectionCallInfo ) + if (!NT_SUCCESS(Status)) { - if (FCB->ListenIrp.ConnectionReturnInfo) - { - ExFreePool(FCB->ListenIrp.ConnectionReturnInfo); - FCB->ListenIrp.ConnectionReturnInfo = NULL; - } - - if (FCB->ListenIrp.ConnectionCallInfo) - { - ExFreePool(FCB->ListenIrp.ConnectionCallInfo); - FCB->ListenIrp.ConnectionCallInfo = NULL; - } - - return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 ); + ExFreePool(FCB->ListenIrp.ConnectionCallInfo); + FCB->ListenIrp.ConnectionCallInfo = NULL; + return UnlockAndMaybeComplete(FCB, Status, Irp, 0); } FCB->State = SOCKET_STATE_LISTENING; @@ -337,29 +330,22 @@ Status = WarmSocketForConnection( FCB ); if( Status == STATUS_SUCCESS ) { - TdiBuildNullConnectionInfo - ( &FCB->ListenIrp.ConnectionCallInfo, - FCB->LocalAddress->Address[0].AddressType ); - TdiBuildNullConnectionInfo - ( &FCB->ListenIrp.ConnectionReturnInfo, - FCB->LocalAddress->Address[0].AddressType ); - - if( !FCB->ListenIrp.ConnectionReturnInfo || !FCB->ListenIrp.ConnectionCallInfo ) - { - if (FCB->ListenIrp.ConnectionReturnInfo) - { - ExFreePool(FCB->ListenIrp.ConnectionReturnInfo); - FCB->ListenIrp.ConnectionReturnInfo = NULL; - } - - if (FCB->ListenIrp.ConnectionCallInfo) - { - ExFreePool(FCB->ListenIrp.ConnectionCallInfo); - FCB->ListenIrp.ConnectionCallInfo = NULL; - } - - return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, Irp, 0 ); - } + Status = TdiBuildNullConnectionInfo + ( &FCB->ListenIrp.ConnectionCallInfo, + FCB->LocalAddress->Address[0].AddressType ); + + if (!NT_SUCCESS(Status)) return UnlockAndMaybeComplete(FCB, Status, Irp, 0); + + Status = TdiBuildNullConnectionInfo + ( &FCB->ListenIrp.ConnectionReturnInfo, + FCB->LocalAddress->Address[0].AddressType ); + + if (!NT_SUCCESS(Status)) + { + ExFreePool(FCB->ListenIrp.ConnectionCallInfo); + FCB->ListenIrp.ConnectionCallInfo = NULL; + return UnlockAndMaybeComplete(FCB, Status, Irp, 0); + } Status = TdiListen( &FCB->ListenIrp.InFlightRequest, FCB->Connection.Object, Modified: branches/aicom-network-branch/drivers/network/afd/afd/main.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-branch/drivers/ne…
============================================================================== --- branches/aicom-network-branch/drivers/network/afd/afd/main.c [iso-8859-1] (original) +++ branches/aicom-network-branch/drivers/network/afd/afd/main.c [iso-8859-1] Wed Feb 3 21:02:39 2010 @@ -498,7 +498,7 @@ ( &ConnectionReturnInfo, FCB->RemoteAddress->Address[0].AddressType ); if( !NT_SUCCESS(Status) ) - return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY, + return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); if( DisReq->DisconnectType & AFD_DISCONNECT_SEND ) Modified: branches/aicom-network-branch/drivers/network/afd/afd/tdiconn.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-branch/drivers/ne…
============================================================================== --- branches/aicom-network-branch/drivers/network/afd/afd/tdiconn.c [iso-8859-1] (original) +++ branches/aicom-network-branch/drivers/network/afd/afd/tdiconn.c [iso-8859-1] Wed Feb 3 21:02:39 2010 @@ -14,13 +14,21 @@ UINT TdiAddressSizeFromType( UINT AddressType ) { switch( AddressType ) { - case AF_INET: + case TDI_ADDRESS_TYPE_IP: return sizeof(TA_IP_ADDRESS); + case TDI_ADDRESS_TYPE_APPLETALK: + return sizeof(TA_APPLETALK_ADDRESS); + case TDI_ADDRESS_TYPE_NETBIOS: + return sizeof(TA_NETBIOS_ADDRESS); + /* case TDI_ADDRESS_TYPE_NS: */ + case TDI_ADDRESS_TYPE_IPX: + return sizeof(TA_IPX_ADDRESS); + case TDI_ADDRESS_TYPE_VNS: + return sizeof(TA_VNS_ADDRESS); default: - AFD_DbgPrint(MID_TRACE,("TdiAddressSizeFromType - invalid type: %x\n", AddressType)); - KeBugCheck( 0 ); + DbgPrint("TdiAddressSizeFromType - invalid type: %x\n", AddressType); + return 0; } - return 0; } UINT TaLengthOfAddress( PTA_ADDRESS Addr ) { @@ -85,6 +93,8 @@ PTRANSPORT_ADDRESS TransportAddress; TdiAddressSize = TdiAddressSizeFromType(Type); + if (!TdiAddressSize) + return STATUS_INVALID_PARAMETER; RtlZeroMemory(ConnInfo, sizeof(TDI_CONNECTION_INFORMATION) + @@ -118,6 +128,10 @@ NTSTATUS Status; TdiAddressSize = TdiAddressSizeFromType(Type); + if (!TdiAddressSize) { + *ConnectionInfo = NULL; + return STATUS_INVALID_PARAMETER; + } ConnInfo = (PTDI_CONNECTION_INFORMATION) ExAllocatePool(NonPagedPool, @@ -199,6 +213,9 @@ /* FIXME: Get from socket information */ TdiAddressSize = TdiAddressSizeFromType(From->Address[0].AddressType); + if (!TdiAddressSize) + return STATUS_INVALID_PARAMETER; + SizeOfEntry = TdiAddressSize + sizeof(TDI_CONNECTION_INFORMATION); LayoutFrame = (PCHAR)ExAllocatePool(NonPagedPool, 2 * SizeOfEntry); Modified: branches/aicom-network-branch/drivers/network/afd/afd/write.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-branch/drivers/ne…
============================================================================== --- branches/aicom-network-branch/drivers/network/afd/afd/write.c [iso-8859-1] (original) +++ branches/aicom-network-branch/drivers/network/afd/afd/write.c [iso-8859-1] Wed Feb 3 21:02:39 2010 @@ -247,9 +247,9 @@ Irp, 0 ); } - TdiBuildConnectionInfo( &TargetAddress, FCB->RemoteAddress ); - - if( TargetAddress ) { + Status = TdiBuildConnectionInfo( &TargetAddress, FCB->RemoteAddress ); + + if( NT_SUCCESS(Status) ) { Status = TdiSendDatagram ( &FCB->SendIrp.InFlightRequest, FCB->AddressFile.Object, @@ -261,7 +261,7 @@ FCB ); ExFreePool( TargetAddress ); - } else Status = STATUS_NO_MEMORY; + } if( Status == STATUS_PENDING ) Status = STATUS_SUCCESS; @@ -419,12 +419,12 @@ ((PTRANSPORT_ADDRESS)SendReq->TdiConnection.RemoteAddress)-> Address[0].AddressType)); - TdiBuildConnectionInfo( &TargetAddress, + Status = TdiBuildConnectionInfo( &TargetAddress, ((PTRANSPORT_ADDRESS)SendReq->TdiConnection.RemoteAddress) ); /* Check the size of the Address given ... */ - if( TargetAddress ) { + if( NT_SUCCESS(Status) ) { Status = TdiSendDatagram ( &FCB->SendIrp.InFlightRequest, FCB->AddressFile.Object, @@ -436,7 +436,7 @@ FCB ); ExFreePool( TargetAddress ); - } else Status = STATUS_NO_MEMORY; + } if( Status == STATUS_PENDING ) Status = STATUS_SUCCESS;
14 years, 10 months
1
0
0
0
[tkreuzer] 45399: [NTOS] - Get rid of all Ke386* inline functions for amd64 - add some stubs for msvc
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Feb 3 19:53:41 2010 New Revision: 45399 URL:
http://svn.reactos.org/svn/reactos?rev=45399&view=rev
Log: [NTOS] - Get rid of all Ke386* inline functions for amd64 - add some stubs for msvc Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/intrin_i.h branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/intrin_i.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/intrin_i.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/amd64/intrin_i.h [iso-8859-1] Wed Feb 3 19:53:41 2010 @@ -1,13 +1,12 @@ #ifndef _INTRIN_INTERNAL_ #define _INTRIN_INTERNAL_ -#ifdef CONFIG_SMP -#define LOCK "lock ; " -#else -#define LOCK "" -#endif - -#define KeSetCurrentIrql(x) __writecr8(x) +VOID +FORCEINLINE +KeSetCurrentIrql(KIRQL Irql) +{ + __writecr8(Irql); +} PKGDTENTRY64 FORCEINLINE @@ -103,344 +102,41 @@ } -#define _Ke386GetSeg(N) ({ \ - unsigned int __d; \ - __asm__("movl %%" #N ",%0\n\t" :"=r" (__d)); \ - __d; \ - }) +#elif defined(_MSC_VER) -#define _Ke386SetSeg(N,X) __asm__ __volatile__("movl %0,%%" #N : :"r" (X)); +#define UNIMPLEMENTED DbgPrint("%s is unimplemented!!!\n", __FUNCTION__); -#define _Ke386GetDr(N) ({ \ - unsigned int __d; \ - __asm__("movq %%dr" #N ",%0\n\t" :"=r" (__d)); \ - __d; \ - }) +void FORCEINLINE __lgdt(void *Source) +{ + UNIMPLEMENTED; +} -#define _Ke386SetDr(N,X) __asm__ __volatile__("movl %0,%%dr" #N : :"r" (X)); +void FORCEINLINE __sgdt(void *Destination) +{ + UNIMPLEMENTED; +} + +void FORCEINLINE __lldt(unsigned short Value) +{ + UNIMPLEMENTED; +} + +void FORCEINLINE __sldt(void *Destination) +{ + UNIMPLEMENTED; +} + +void FORCEINLINE __ltr(unsigned short Source) +{ + UNIMPLEMENTED; +} + +void FORCEINLINE __str(unsigned short *Destination) +{ + UNIMPLEMENTED; +} -static inline void Ki386Cpuid(ULONG Op, PULONG Eax, PULONG Ebx, PULONG Ecx, PULONG Edx) -{ - __asm__("cpuid" - : "=a" (*Eax), "=b" (*Ebx), "=c" (*Ecx), "=d" (*Edx) - : "0" (Op)); -} - -#define Ke386Rdmsr(msr,val1,val2) __asm__ __volatile__("rdmsr" : "=a" (val1), "=d" (val2) : "c" (msr)) -#define Ke386Wrmsr(msr,val1,val2) __asm__ __volatile__("wrmsr" : /* no outputs */ : "c" (msr), "a" (val1), "d" (val2)) - -#define Ke386HaltProcessor() __asm__("hlt\n\t"); - -#define Ke386FnInit() __asm__("fninit\n\t"); - - -// -// CR Macros -// -#define Ke386SetCr2(X) __asm__ __volatile__("movq %0,%%cr2" : :"r" ((void*)X)); - -// -// DR Macros -// -#define Ke386GetDr0() _Ke386GetDr(0) -#define Ke386GetDr1() _Ke386GetDr(1) -#define Ke386SetDr0(X) _Ke386SetDr(0,X) -#define Ke386SetDr1(X) _Ke386SetDr(1,X) -#define Ke386GetDr2() _Ke386GetDr(2) -#define Ke386SetDr2(X) _Ke386SetDr(2,X) -#define Ke386GetDr3() _Ke386GetDr(3) -#define Ke386SetDr3(X) _Ke386SetDr(3,X) -#define Ke386GetDr4() _Ke386GetDr(4) -#define Ke386SetDr4(X) _Ke386SetDr(4,X) -#define Ke386GetDr6() _Ke386GetDr(6) -#define Ke386SetDr6(X) _Ke386SetDr(6,X) -#define Ke386GetDr7() _Ke386GetDr(7) -#define Ke386SetDr7(X) _Ke386SetDr(7,X) - -// -// Segment Macros -// -#define Ke386GetSs() _Ke386GetSeg(ss) -#define Ke386GetFs() _Ke386GetSeg(fs) -#define Ke386SetFs(X) _Ke386SetSeg(fs, X) -#define Ke386SetGs(X) _Ke386SetSeg(gs, X) -#define Ke386SetDs(X) _Ke386SetSeg(ds, X) -#define Ke386SetEs(X) _Ke386SetSeg(es, X) -#define Ke386SetSs(X) _Ke386SetSeg(ss, X) - -#elif defined(_MSC_VER) - -VOID -FORCEINLINE -Ke386Wrmsr(IN ULONG Register, - IN ULONG Var1, - IN ULONG Var2) -{ - __writemsr(Register, (ULONG64)Var1 <<32 | Var2); -} - -ULONGLONG -FORCEINLINE -Ke386Rdmsr(IN ULONG Register, - IN ULONG Var1, - IN ULONG Var2) -{ - return __readmsr(Register); -} - -#define UNIMPLEMENTED DbgPrint("unimplemented!!!\n"); - -VOID -FORCEINLINE -Ki386Cpuid(IN ULONG Operation, - OUT PULONG Var1, - OUT PULONG Var2, - OUT PULONG Var3, - OUT PULONG Var4) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386FnInit(VOID) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386HaltProcessor(VOID) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386GetInterruptDescriptorTable(OUT KDESCRIPTOR Descriptor) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetInterruptDescriptorTable(IN KDESCRIPTOR Descriptor) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386GetGlobalDescriptorTable(OUT KDESCRIPTOR Descriptor) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetGlobalDescriptorTable(IN KDESCRIPTOR Descriptor) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386GetLocalDescriptorTable(OUT USHORT Descriptor) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetLocalDescriptorTable(IN USHORT Descriptor) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SaveFlags(IN ULONG Flags) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386RestoreFlags(IN ULONG Flags) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetTr(IN USHORT Tr) -{ - UNIMPLEMENTED; -} - -USHORT -FORCEINLINE -Ke386GetTr(IN USHORT Tr) -{ - UNIMPLEMENTED; -} - -// -// CR Macros -// -VOID -FORCEINLINE -Ke386SetCr2(IN ULONG Value) -{ - UNIMPLEMENTED; -} - -// -// DR Macros -// -ULONG -FORCEINLINE -Ke386GetDr0(VOID) -{ - UNIMPLEMENTED; -} - -ULONG -FORCEINLINE -Ke386GetDr1(VOID) -{ - UNIMPLEMENTED; -} - -ULONG -FORCEINLINE -Ke386GetDr2(VOID) -{ - UNIMPLEMENTED; -} - -ULONG -FORCEINLINE -Ke386GetDr3(VOID) -{ - UNIMPLEMENTED; -} - -ULONG -FORCEINLINE -Ke386GetDr6(VOID) -{ - UNIMPLEMENTED; -} - -ULONG -FORCEINLINE -Ke386GetDr7(VOID) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetDr0(IN ULONG Value) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetDr1(IN ULONG Value) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetDr2(IN ULONG Value) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetDr3(IN ULONG Value) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetDr6(IN ULONG Value) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetDr7(IN ULONG Value) -{ - UNIMPLEMENTED; -} - -// -// Segment Macros -// -USHORT -FORCEINLINE -Ke386GetSs(VOID) -{ - UNIMPLEMENTED; -} - -USHORT -FORCEINLINE -Ke386GetFs(VOID) -{ - UNIMPLEMENTED; -} - -USHORT -FORCEINLINE -Ke386GetDs(VOID) -{ - UNIMPLEMENTED; -} - -USHORT -FORCEINLINE -Ke386GetEs(VOID) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetSs(IN USHORT Value) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetFs(IN USHORT Value) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetDs(IN USHORT Value) -{ - UNIMPLEMENTED; -} - -VOID -FORCEINLINE -Ke386SetEs(IN USHORT Value) -{ - UNIMPLEMENTED; -} #else #error Unknown compiler for inline assembler Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/kiinit.c [iso-8859-1] Wed Feb 3 19:53:41 2010 @@ -389,11 +389,6 @@ __writemsr(X86_MSR_GSBASE, (ULONG64)Pcr); __writemsr(X86_MSR_KERNEL_GSBASE, (ULONG64)Pcr); - /* Load Ring 3 selectors for DS/ES/FS */ - Ke386SetDs(KGDT64_R3_DATA | RPL_MASK); - Ke386SetEs(KGDT64_R3_DATA | RPL_MASK); - Ke386SetFs(KGDT64_R3_CMTEB | RPL_MASK); - /* LDT is unused */ __lldt(0);
14 years, 10 months
1
0
0
0
[tkreuzer] 45398: Add some EXTERNs and use OR instead of | for MASM/ML compatibility
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Feb 3 19:49:44 2010 New Revision: 45398 URL:
http://svn.reactos.org/svn/reactos?rev=45398&view=rev
Log: Add some EXTERNs and use OR instead of | for MASM/ML compatibility Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
============================================================================== --- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] Wed Feb 3 19:49:44 2010 @@ -14,6 +14,10 @@ EXTERN _FrLdrDbgPrint:DWORD EXTERN _KeBugCheckWithTf:PROC EXTERN _MmAccessFault:PROC +EXTERN _KiSystemFatalException:PROC +EXTERN _KiNpxNotAvailableFaultHandler:PROC +EXTERN _KiGeneralProtectionFaultHandler:PROC +EXTERN _KiXmmExceptionHandler:PROC /* GLOBALS *******************************************************************/ @@ -275,6 +279,7 @@ /* Allocate stack space for EXCEPTION_RECORD and KEXCEPTION_FRAME */ sub rsp, SIZE_EXCEPTION_RECORD + SIZE_KEXCEPTION_FRAME .allocstack (SIZE_EXCEPTION_RECORD + SIZE_KEXCEPTION_FRAME) + .endprolog /* Set up EXCEPTION_RECORD */ lea rcx, [rsp + SIZE_KEXCEPTION_FRAME] @@ -588,7 +593,7 @@ PUBLIC _KiInvalidTssFault .PROC _KiInvalidTssFault /* We have an error code */ - ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE | TRAPFLAG_ALL) + ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL) /* Bugcheck */ mov ecx, EXCEPTION_INVALID_TSS @@ -602,7 +607,7 @@ PUBLIC _KiSegmentNotPresentFault .PROC _KiSegmentNotPresentFault /* We have an error code */ - ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE | TRAPFLAG_ALL) + ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL) /* Bugcheck */ mov ecx, EXCEPTION_SEGMENT_NOT_PRESENT @@ -616,7 +621,7 @@ PUBLIC _KiStackFault .PROC _KiStackFault /* We have an error code */ - ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE | TRAPFLAG_ALL) + ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL) /* Bugcheck */ mov ecx, EXCEPTION_STACK_FAULT @@ -630,7 +635,7 @@ PUBLIC _KiGeneralProtectionFault .PROC _KiGeneralProtectionFault /* We have an error code */ - ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE | TRAPFLAG_ALL) + ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL) TRAPINFO KiGeneralProtectionFault mov rdx, [rbp + KTRAP_FRAME_Rip] @@ -672,7 +677,7 @@ PUBLIC _KiPageFault .PROC _KiPageFault /* We have an error code */ - ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE | TRAPFLAG_ALL) + ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL) TRAPINFO KiPageFault @@ -751,7 +756,7 @@ PUBLIC _KiAlignmentFault .PROC _KiAlignmentFault /* We have an error code */ - ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE | TRAPFLAG_ALL) + ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL) /* Enable interrupts */ sti @@ -808,7 +813,7 @@ PUBLIC _KiApcInterrupt .PROC _KiApcInterrupt /* We have an error code */ - ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE | TRAPFLAG_ALL) + ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL) UNIMPLEMENTED KiApcInterrupt @@ -819,7 +824,7 @@ PUBLIC _KiRaiseAssertion .PROC _KiRaiseAssertion /* We have an error code */ - ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE | TRAPFLAG_ALL) + ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL) /* Decrement RIP to point to the INT2C instruction (2 bytes, not 1 like INT3) */ sub qword ptr [rbp + KTRAP_FRAME_Rip], 2 @@ -863,7 +868,7 @@ PUBLIC _KiDpcInterrupt .PROC _KiDpcInterrupt /* We have an error code */ - ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE | TRAPFLAG_ALL) + ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL) UNIMPLEMENTED KiDpcInterrupt @@ -874,7 +879,7 @@ PUBLIC _KiIpiInterrupt .PROC _KiIpiInterrupt /* We have an error code */ - ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE | TRAPFLAG_ALL) + ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL) UNIMPLEMENTED KiIpiInterrupt @@ -886,7 +891,7 @@ .PROC _KiUnexpectedInterrupt /* The error code is the vector */ cli - ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE | TRAPFLAG_ALL) + ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL) /* Set bugcheck parameters */ mov ecx, TRAP_CAUSE_UNKNOWN
14 years, 10 months
1
0
0
0
[tkreuzer] 45397: Fix setjmp based on the new syntax
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Feb 3 19:47:30 2010 New Revision: 45397 URL:
http://svn.reactos.org/svn/reactos?rev=45397&view=rev
Log: Fix setjmp based on the new syntax Modified: branches/ros-amd64-bringup/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s Modified: branches/ros-amd64-bringup/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/s…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s [iso-8859-1] Wed Feb 3 19:47:30 2010 @@ -8,10 +8,8 @@ /* INCLUDES ******************************************************************/ +#include <reactos/asm.h> #include <ndk/amd64/asm.h> -#include <ndk/amd64/asmmacro.S> - -.intel_syntax noprefix #define JUMP_BUFFER_Frame 0x00 #define JUMP_BUFFER_Rbx 0x08 @@ -46,7 +44,8 @@ * Returns: 0 * Notes: Sets up the jmp_buf */ -.proc _setjmp +PUBLIC __setjmp +.proc __setjmp /* Load rsp as it was before the call into rax */ lea rax, [rsp + 8] /* Load return address into r8 */ @@ -74,7 +73,7 @@ movdqa [rcx + JUMP_BUFFER_Xmm15], xmm15 xor rax, rax ret -.endproc +.endp /* * int _setjmpex(jmp_buf _Buf,void *_Ctx); @@ -84,7 +83,8 @@ * Returns: 0 * Notes: Sets up the jmp_buf */ -.proc _setjmpex +PUBLIC __setjmpex +.proc __setjmpex /* Load rsp as it was before the call into rax */ lea rax, [rsp + 8] /* Load return address into r8 */ @@ -112,7 +112,7 @@ movdqa [rcx + JUMP_BUFFER_Xmm15], xmm15 xor rax, rax ret -.endproc +.endp /* @@ -123,7 +123,8 @@ * Returns: Doesn't return * Notes: Non-local goto */ -.proc longjmp +PUBLIC _longjmp +.proc _longjmp // FIXME: handle frame @@ -154,4 +155,4 @@ jnz 2f inc rax 2: jmp r8 -.endproc +.endp
14 years, 10 months
1
0
0
0
[sir_richard] 45396: [VMX_SVGA]: Begin implementation of VMWARE SVGA-II Video Card Driver.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Wed Feb 3 18:47:41 2010 New Revision: 45396 URL:
http://svn.reactos.org/svn/reactos?rev=45396&view=rev
Log: [VMX_SVGA]: Begin implementation of VMWARE SVGA-II Video Card Driver. Added: trunk/reactos/drivers/video/miniport/vmx_svga/ trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h (with props) trunk/reactos/drivers/video/miniport/vmx_svga/vmx_regs.h (with props) trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c (with props) trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.rbuild (with props) trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.rc (with props) Modified: trunk/reactos/drivers/video/miniport/directory.rbuild Modified: trunk/reactos/drivers/video/miniport/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/dir…
============================================================================== --- trunk/reactos/drivers/video/miniport/directory.rbuild [iso-8859-1] (original) +++ trunk/reactos/drivers/video/miniport/directory.rbuild [iso-8859-1] Wed Feb 3 18:47:41 2010 @@ -7,6 +7,9 @@ <directory name="vga"> <xi:include href="vga/vgamp.rbuild" /> </directory> + <directory name="vmx_svga"> + <xi:include href="vmx_svga/vmx_svga.rbuild" /> + </directory> <directory name="xboxvmp"> <xi:include href="xboxvmp/xboxvmp.rbuild" /> </directory> Added: trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vmx…
============================================================================== --- trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h (added) +++ trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h [iso-8859-1] Wed Feb 3 18:47:41 2010 @@ -1,0 +1,37 @@ +/* + * PROJECT: ReactOS Boot Loader + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: drivers/video/miniport/vmx_svga/precomp.h + * PURPOSE: VMWARE SVGA-II Driver Header + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +#include <ntddk.h> +#include <dderror.h> +#include <miniport.h> +#include <ntddvdeo.h> +#include <video.h> +#include "vmx_regs.h" + +typedef struct _HW_DEVICE_EXTENSION +{ + USHORT Version; + PHYSICAL_ADDRESS FrameBuffer; + LARGE_INTEGER VramSize; + PHYSICAL_ADDRESS VramBase; + ULONG MemSize; + ULONG IndexPort; + ULONG ValuePort; + PVOID FrameBufferBase; + PVOID Fifo; + ULONG InterruptPort; + ULONG InterruptState; + PKEVENT SyncEvent; + VIDEO_MODE_INFORMATION CurrentMode; + ULONG VideoModeCount; + ULONG Capabilities; + USHORT Flags; + USHORT DisplayIndex; + ULONG YOrigin; + ULONG XOrigin; +} HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION; Propchange: trunk/reactos/drivers/video/miniport/vmx_svga/precomp.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/drivers/video/miniport/vmx_svga/vmx_regs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vmx…
============================================================================== --- trunk/reactos/drivers/video/miniport/vmx_svga/vmx_regs.h (added) +++ trunk/reactos/drivers/video/miniport/vmx_svga/vmx_regs.h [iso-8859-1] Wed Feb 3 18:47:41 2010 @@ -1,0 +1,130 @@ +/* + * PROJECT: ReactOS Boot Loader + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: drivers/video/miniport/vmx_svga/vmware.h + * PURPOSE: VMWARE SVGA-II Card Registers and Definitions + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +// +// IT'S OVER 9000 THOUSAND!!!!!!!!!! +// +#define SVGA_MAGIC 0x900000 + +// +// Known VMWARE SVGA Versions +// +#define SVGA_VERSION_2 2 +#define SVGA_VERSION_1 1 +#define SVGA_VERSION_0 0 + +// +// Known VMWARE SVGA IDs +// +#define SVGA_MAKE_ID(x) (SVGA_MAGIC << 8 | (x)) +#define SVGA_ID_2 SVGA_MAKE_ID(SVGA_VERSION_2) +#define SVGA_ID_1 SVGA_MAKE_ID(SVGA_VERSION_1) +#define SVGA_ID_0 SVGA_MAKE_ID(SVGA_VERSION_0) +#define SVGA_ID_INVALID 0xFFFFFFFF + +// +// Card Capabilities +// +#define SVGA_CAP_NONE 0x00000000 +#define SVGA_CAP_RECT_FILL 0x00000001 +#define SVGA_CAP_RECT_COPY 0x00000002 +#define SVGA_CAP_RECT_PAT_FILL 0x00000004 +#define SVGA_CAP_LEGACY_OFFSCREEN 0x00000008 +#define SVGA_CAP_RASTER_OP 0x00000010 +#define SVGA_CAP_CURSOR 0x00000020 +#define SVGA_CAP_CURSOR_BYPASS 0x00000040 +#define SVGA_CAP_CURSOR_BYPASS_2 0x00000080 +#define SVGA_CAP_8BIT_EMULATION 0x00000100 +#define SVGA_CAP_ALPHA_CURSOR 0x00000200 +#define SVGA_CAP_GLYPH 0x00000400 +#define SVGA_CAP_GLYPH_CLIPPING 0x00000800 +#define SVGA_CAP_OFFSCREEN_1 0x00001000 +#define SVGA_CAP_ALPHA_BLEND 0x00002000 +#define SVGA_CAP_3D 0x00004000 +#define SVGA_CAP_EXTENDED_FIFO 0x00008000 +#define SVGA_CAP_MULTIMON 0x00010000 +#define SVGA_CAP_PITCHLOCK 0x00020000 +#define SVGA_CAP_IRQMASK 0x00040000 +#define SVGA_CAP_DISPLAY_TOPOLOGY 0x00080000 + +// +// Port Offsets and Base in PCI Space +// +#define SVGA_LEGACY_BASE_PORT 0x4560 +#define SVGA_INDEX_PORT 0x0 +#define SVGA_VALUE_PORT 0x1 +#define SVGA_BIOS_PORT 0x2 +#define SVGA_NUM_PORTS 0x3 +#define SVGA_IRQSTATUS_PORT 0x8 + +// +// Invalid display ID +// +#define SVGA_INVALID_DISPLAY_ID 0xFFFFFFFF + +// +// Global Maximums +// +#define SVGA_MAX_BITS_PER_PIXEL 32 +#define SVGA_MAX_DEPTH 24 +#define SVGA_MAX_DISPLAYS 10 +#define SVGA_MAX_PSEUDOCOLOR_DEPTH 8 +#define SVGA_MAX_PSEUDOCOLORS (1 << SVGA_MAX_PSEUDOCOLOR_DEPTH) +#define SVGA_NUM_PALETTE_REGS (3 * SVGA_MAX_PSEUDOCOLORS) +#define SVGA_FB_MAX_SIZE \ + ((((SVGA_MAX_WIDTH * SVGA_MAX_HEIGHT * \ + SVGA_MAX_BITS_PER_PIXEL / 8) >> PAGE_SHIFT) + 1) << PAGE_SHIFT) + +// +// Card Registers +// +typedef enum _VMX_SVGA_REGISTERS +{ + SVGA_REG_ID, + SVGA_REG_ENABLE, + SVGA_REG_WIDTH, + SVGA_REG_HEIGHT, + SVGA_REG_MAX_WIDTH, + SVGA_REG_MAX_HEIGHT, + SVGA_REG_DEPTH, + SVGA_REG_BITS_PER_PIXEL, + SVGA_REG_PSEUDOCOLOR, + SVGA_REG_RED_MASK, + SVGA_REG_GREEN_MASK, + SVGA_REG_BLUE_MASK, + SVGA_REG_BYTES_PER_LINE, + SVGA_REG_FB_START, + SVGA_REG_FB_OFFSET, + SVGA_REG_VRAM_SIZE, + SVGA_REG_FB_SIZE, + SVGA_REG_CAPABILITIES, + SVGA_REG_MEM_START, + SVGA_REG_MEM_SIZE, + SVGA_REG_CONFIG_DONE, + SVGA_REG_SYNC, + SVGA_REG_BUSY, + SVGA_REG_GUEST_ID, + SVGA_REG_CURSOR_ID, + SVGA_REG_CURSOR_X, + SVGA_REG_CURSOR_Y, + SVGA_REG_CURSOR_ON, + SVGA_REG_HOST_BITS_PER_PIXEL, + SVGA_REG_SCRATCH_SIZE, + SVGA_REG_MEM_REGS, + SVGA_REG_NUM_DISPLAYS, + SVGA_REG_PITCHLOCK, + SVGA_REG_IRQMASK, + SVGA_REG_NUM_GUEST_DISPLAYS, + SVGA_REG_DISPLAY_ID, + SVGA_REG_DISPLAY_IS_PRIMARY, + SVGA_REG_DISPLAY_POSITION_X, + SVGA_REG_DISPLAY_POSITION_Y, + SVGA_REG_DISPLAY_WIDTH, + SVGA_REG_DISPLAY_HEIGHT, + SVGA_REG_TOP, +} VMX_SVGA_REGISTERS; Propchange: trunk/reactos/drivers/video/miniport/vmx_svga/vmx_regs.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vmx…
============================================================================== --- trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c (added) +++ trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c [iso-8859-1] Wed Feb 3 18:47:41 2010 @@ -1,0 +1,117 @@ +/* + * PROJECT: ReactOS Boot Loader + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: drivers/video/miniport/vmx_svga/vmx_svga.c + * PURPOSE: VMWARE SVGA-II Card Main Driver File + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES *******************************************************************/ + +#include "precomp.h" + +/* GLOBALS ********************************************************************/ + +PHW_DEVICE_EXTENSION VmxDeviceExtensionArray[SVGA_MAX_DISPLAYS]; + +/* FUNCTIONS ******************************************************************/ + +VP_STATUS +NTAPI +VmxFindAdapter(IN PVOID HwDeviceExtension, + IN PVOID HwContext, + IN PWSTR ArgumentString, + IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo, + OUT PUCHAR Again) +{ + return NO_ERROR; +} + +BOOLEAN +NTAPI +VmxInitialize(IN PVOID HwDeviceExtension) +{ + return TRUE; +} + +BOOLEAN +NTAPI +VmxStartIO(IN PVOID HwDeviceExtension, + IN PVIDEO_REQUEST_PACKET RequestPacket) +{ + return TRUE; +} + +BOOLEAN +NTAPI +VmxResetHw(IN PVOID DeviceExtension, + IN ULONG Columns, + IN ULONG Rows) +{ + return FALSE; +} + +VP_STATUS +NTAPI +VmxGetPowerState(IN PVOID HwDeviceExtension, + IN ULONG HwId, + IN PVIDEO_POWER_MANAGEMENT VideoPowerControl) +{ + return NO_ERROR; +} + +VP_STATUS +NTAPI +VmxSetPowerState(IN PVOID HwDeviceExtension, + IN ULONG HwId, + IN PVIDEO_POWER_MANAGEMENT VideoPowerControl) +{ + + return NO_ERROR; +} + +BOOLEAN +NTAPI +VmxInterrupt(IN PVOID HwDeviceExtension) +{ + return TRUE; +} + +VP_STATUS +NTAPI +VmxGetVideoChildDescriptor(IN PVOID HwDeviceExtension, + IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo, + OUT PVIDEO_CHILD_TYPE VideoChildType, + OUT PUCHAR pChildDescriptor, + OUT PULONG UId, + OUT PULONG pUnused) +{ + return NO_ERROR; +} + +VP_STATUS +NTAPI +DriverEntry(IN PVOID Context1, + IN PVOID Context2) +{ + VIDEO_HW_INITIALIZATION_DATA InitData; + + /* Zero initialization structure and array of extensions, one per screen */ + VideoPortZeroMemory(VmxDeviceExtensionArray, sizeof(VmxDeviceExtensionArray)); + VideoPortZeroMemory(&InitData, sizeof(InitData)); + + /* Setup the initialization structure with VideoPort */ + InitData.HwInitDataSize = sizeof(VIDEO_HW_INITIALIZATION_DATA); + InitData.HwFindAdapter = VmxFindAdapter; + InitData.HwInitialize = VmxInitialize; + InitData.HwInterrupt = VmxInterrupt; + InitData.HwStartIO = VmxStartIO; + InitData.HwResetHw = VmxResetHw; + InitData.HwGetPowerState = VmxGetPowerState; + InitData.HwSetPowerState = VmxSetPowerState; + InitData.HwGetVideoChildDescriptor = VmxGetVideoChildDescriptor; + InitData.AdapterInterfaceType = PCIBus; + InitData.HwInitDataSize = sizeof(VIDEO_HW_INITIALIZATION_DATA); + InitData.HwDeviceExtensionSize = sizeof(HW_DEVICE_EXTENSION); + return VideoPortInitialize(Context1, Context2, &InitData, NULL); +} Propchange: trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vmx…
============================================================================== --- trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.rbuild (added) +++ trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.rbuild [iso-8859-1] Wed Feb 3 18:47:41 2010 @@ -1,0 +1,9 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd"> +<module name="vmx_svga" type="kernelmodedriver" installbase="system32/drivers" installname="vmx_svga.sys"> + <include base="vmx_svga">.</include> + <library>videoprt</library> + <file>vmx_svga.c</file> + <file>vmx_svga.rc</file> + <pch>precomp.h</pch> +</module> Propchange: trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/miniport/vmx…
============================================================================== --- trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.rc (added) +++ trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.rc [iso-8859-1] Wed Feb 3 18:47:41 2010 @@ -1,0 +1,5 @@ +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "VMWARE SVGA-II Miniport Device Driver\0" +#define REACTOS_STR_INTERNAL_NAME "vmx_svga\0" +#define REACTOS_STR_ORIGINAL_FILENAME "vmx_svga.sys\0" +#include <reactos/version.rc> Propchange: trunk/reactos/drivers/video/miniport/vmx_svga/vmx_svga.rc ------------------------------------------------------------------------------ svn:eol-style = native
14 years, 10 months
1
0
0
0
[jcatena] 45395: [NTOS] trap stub
by jcatena@svn.reactos.org
Author: jcatena Date: Wed Feb 3 18:27:09 2010 New Revision: 45395 URL:
http://svn.reactos.org/svn/reactos?rev=45395&view=rev
Log: [NTOS] trap stub Added: branches/jcatena-branch/ntoskrnl/trap/syscall.c (with props) Modified: branches/jcatena-branch/ntoskrnl/trap/trap.c branches/jcatena-branch/ntoskrnl/trap/trap.h Added: branches/jcatena-branch/ntoskrnl/trap/syscall.c URL:
http://svn.reactos.org/svn/reactos/branches/jcatena-branch/ntoskrnl/trap/sy…
============================================================================== --- branches/jcatena-branch/ntoskrnl/trap/syscall.c (added) +++ branches/jcatena-branch/ntoskrnl/trap/syscall.c [iso-8859-1] Wed Feb 3 18:27:09 2010 @@ -1,0 +1,171 @@ + +VOID +FASTCALL +// KiSystemCall(IN ULONG SystemCallNumber, IN PVOID Arguments) +KiSystemCall(KTRAP_FRAME *TrapFrame) +{ + PVOID Arguments; + PKTHREAD Thread; + PKTRAP_FRAME TrapFrame; + PKSERVICE_TABLE_DESCRIPTOR DescriptorTable; + ULONG Id, Offset, StackBytes; + PVOID Handler; + ULONG Result; + + CpuSetFs(KGDT_R0_PCR); + + // get arguments + Arguments = TrapFrame->Edx; + + /* Chain trap frames !!! */ + TrapFrame->Edx = (ULONG_PTR)Thread->TrapFrame; + + /* Decode the system call number */ + Offset = (TrapFrame->Eax >> SERVICE_TABLE_SHIFT) & SERVICE_TABLE_MASK; + Id = TrapFrame->Eax & SERVICE_NUMBER_MASK; + + /* Loop because we might need to try this twice in case of a GUI call */ + for(;;) + { + Thread = KeGetCurrentThread(); + DescriptorTable = (PVOID)((ULONG_PTR)Thread->ServiceTable + Offset); + + /* Validate the system call number */ + if (id <= DescriptorTable->limit) + break; + + /* Check if this is a GUI call */ + if (!(Offset & SERVICE_TABLE_TEST)) + { + /* Fail the call */ + Result = STATUS_INVALID_SYSTEM_SERVICE; + goto ExitCall; + } + + /* Convert us to a GUI thread -- must wrap in ASM to get new EBP */ + Result = KiConvertToGuiThread(); + if (!NT_SUCCESS(Result)) + { + /* Figure out how we should fail to the user */ + DPRINT1("KiConvertToGuiThread failed\n"); + for(;;); + } + } + + /* Check if this is a GUI call */ + if (Offset & SERVICE_TABLE_TEST) + { + /* Get the batch count and flush if necessary */ + if (NtCurrentTeb()->GdiBatchCount) KeGdiFlushUserBatch(); + } + + /* Increase system call count */ + KeGetCurrentPrcb()->KeSystemCalls++; + + /* FIXME: Increase individual counts on debug systems */ + //KiIncreaseSystemCallCount(DescriptorTable, Id); + + /* Get stack bytes */ + StackBytes = DescriptorTable->Number[Id]; + + /* Probe caller stack */ + if ( (Arguments < (PVOID)MmUserProbeAddress) && !(KiUserTrap(TrapFrame)) ) + { + /* Access violation */ + DPRINT1("Probe caller stack failed\n"); + for(;;); + } + + /* Get the handler and make the system call */ + Handler = (PVOID)DescriptorTable->Base[Id]; + Result = KiSystemCallTrampoline(Handler, Arguments, StackBytes); + + /* Make sure we're exiting correctly */ + KiExitSystemCallDebugChecks(Id, TrapFrame); + + /* Restore the old trap frame */ +ExitCall: + Thread->TrapFrame = (PKTRAP_FRAME)TrapFrame->Edx; + + /* Disable interrupts until we return */ + CpuIntDisable(); + + /* Check for APC delivery */ + KiCheckForApcDelivery(TrapFrame); + + /* Exit from system call */ + TrapFrame->Eax = Result; + + /* Now exit the trap for real */ + // KiExitTrap(TrapFrame, 0); +} + +VOID +FASTCALL +KiSystemCallHandler(IN PKTRAP_FRAME TrapFrame) + IN KPROCESSOR_MODE PreviousMode, + IN KPROCESSOR_MODE PreviousPreviousMode, +{ + // DPRINTT("\n"); + /* No error code */ + TrapFrame->ErrCode = 0; + + /* Clear direction flag */ + CpuCld(); + + /* Save previous mode and FS segment */ + TrapFrame->PreviousPreviousMode = PreviousPreviousMode; + + /* Save the SEH chain and terminate it for now */ + TrapFrame->ExceptionList = KeGetPcr()->Tib.ExceptionList; + KeGetPcr()->Tib.ExceptionList = EXCEPTION_CHAIN_END; + + /* Clear DR7 and check for debugging */ + TrapFrame->Dr7 = 0; + if (__builtin_expect(Thread->DispatcherHeader.DebugActive & 0xFF, 0)) + { + UNIMPLEMENTED; + while (TRUE); + } + + /* Set thread fields */ + Thread->TrapFrame = TrapFrame; + Thread->PreviousMode = PreviousMode; + + /* Set debug header */ + KiFillTrapFrameDebug(TrapFrame); + + /* Enable interrupts and make the call */ + CpuIntEnable(); + KiSystemCall(ServiceNumber, Arguments); +} + +VOID +_FASTCALL +KiFastCallEntryHandler(IN PKTRAP_FRAME TrapFrame) +{ + DPRINTT("\n"); + + /* Set up a fake INT Stack and enable interrupts */ + TrapFrame->HardwareSegSs = KGDT_R3_DATA | RPL_MASK; + TrapFrame->HardwareEsp = (ULONG_PTR)Arguments - 8; // Stack is 2 frames down + TrapFrame->EFlags |= EFLAGS_INTERRUPT_MASK; // ??? + TrapFrame->SegCs = KGDT_R3_CODE | RPL_MASK; + TrapFrame->Eip = SharedUserData->SystemCallReturn; + __writeeflags(0x2); // !!! sure? shouldn't be necessary + + /* Call the shared handler (inline) */ + KiSystemCallHandler(TrapFrame); +} + +VOID +_FASTCALL +KiSystemServiceHandler(IN PKTRAP_FRAME TrapFrame) +{ + // DPRINTT("\n"); + + /* Call the shared handler (inline) */ + KiSystemCallHandler(TrapFrame);, +} + + Propchange: branches/jcatena-branch/ntoskrnl/trap/syscall.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/jcatena-branch/ntoskrnl/trap/trap.c URL:
http://svn.reactos.org/svn/reactos/branches/jcatena-branch/ntoskrnl/trap/tr…
============================================================================== --- branches/jcatena-branch/ntoskrnl/trap/trap.c [iso-8859-1] (original) +++ branches/jcatena-branch/ntoskrnl/trap/trap.c [iso-8859-1] Wed Feb 3 18:27:09 2010 @@ -1,9 +1,5 @@ -#include <trap.h> - -KPCR const *TrapPcr = PCR; // create stubs - _NOWARN_PUSH _NOWARN_MSC(4005) Modified: branches/jcatena-branch/ntoskrnl/trap/trap.h URL:
http://svn.reactos.org/svn/reactos/branches/jcatena-branch/ntoskrnl/trap/tr…
============================================================================== --- branches/jcatena-branch/ntoskrnl/trap/trap.h [iso-8859-1] (original) +++ branches/jcatena-branch/ntoskrnl/trap/trap.h [iso-8859-1] Wed Feb 3 18:27:09 2010 @@ -1,4 +1,6 @@ _ONCE + +#define DBGTRAPENTRY // TRAP_STUB_FLAGS TrapStub x-macro flags // trap type
14 years, 10 months
1
0
0
0
[tkreuzer] 45394: Improve the UNIMPLEMENTED macro. Dedicated to aicom.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Feb 3 17:57:14 2010 New Revision: 45394 URL:
http://svn.reactos.org/svn/reactos?rev=45394&view=rev
Log: Improve the UNIMPLEMENTED macro. Dedicated to aicom. Modified: branches/ros-amd64-bringup/reactos/include/reactos/asm.h Modified: branches/ros-amd64-bringup/reactos/include/reactos/asm.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
============================================================================== --- branches/ros-amd64-bringup/reactos/include/reactos/asm.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/include/reactos/asm.h [iso-8859-1] Wed Feb 3 17:57:14 2010 @@ -140,7 +140,7 @@ .macro UNIMPLEMENTED2 file, line, func jmp 3f -1: .asciz \func +1: .asciz "\func" 2: .asciz \file 3: sub rsp, 0x20
14 years, 10 months
1
0
0
0
[tkreuzer] 45393: inline -> __inline
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Feb 3 17:50:34 2010 New Revision: 45393 URL:
http://svn.reactos.org/svn/reactos?rev=45393&view=rev
Log: inline -> __inline Modified: branches/ros-amd64-bringup/reactos/lib/rtl/amd64/unwind.c Modified: branches/ros-amd64-bringup/reactos/lib/rtl/amd64/unwind.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/r…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/rtl/amd64/unwind.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/rtl/amd64/unwind.c [iso-8859-1] Wed Feb 3 17:50:34 2010 @@ -232,7 +232,7 @@ */ BOOLEAN static -inline +__inline RtlpTryToUnwindEpilog( PCONTEXT Context, ULONG64 ImageBase,
14 years, 10 months
1
0
0
0
[jcatena] 45392: [NTOS] msc trap stub
by jcatena@svn.reactos.org
Author: jcatena Date: Wed Feb 3 14:25:03 2010 New Revision: 45392 URL:
http://svn.reactos.org/svn/reactos?rev=45392&view=rev
Log: [NTOS] msc trap stub Modified: branches/jcatena-branch/ntoskrnl/trap/i386/TrapStub.h branches/jcatena-branch/ntoskrnl/trap/trap.c branches/jcatena-branch/ntoskrnl/trap/trap.h Modified: branches/jcatena-branch/ntoskrnl/trap/i386/TrapStub.h URL:
http://svn.reactos.org/svn/reactos/branches/jcatena-branch/ntoskrnl/trap/i3…
============================================================================== --- branches/jcatena-branch/ntoskrnl/trap/i386/TrapStub.h [iso-8859-1] (original) +++ branches/jcatena-branch/ntoskrnl/trap/i386/TrapStub.h [iso-8859-1] Wed Feb 3 14:25:03 2010 @@ -6,17 +6,20 @@ #error #endif -#define TRAP_STUB_NAMEH0(x) x##Handler -#define TRAP_STUB_NAMEH1(x) TRAP_STUB_NAMEH0(x) -#define TRAP_STUB_NAMEH TRAP_STUB_NAMEH1(TRAP_STUB_NAME) +#define TRAP_STUB_NAMEH tokenpaste(TRAP_STUB_NAME, Handler) +#if (TRAP_STUB_FLAGS & TRAPF_INTERRUPT) +#define TRAP_STUB_PARAM2 tokenpaste(TRAP_STUB_NAME, Interrupt) +PKINTERRUPT TRAP_STUB_PARAM2; +#else VOID _FASTCALL TRAP_STUB_NAMEH(KTRAP_FRAME *TrapFrame); +#endif _NAKED VOID TRAP_STUB_NAME(VOID) { _ASM_BEGIN // setup frame -#if (TRAP_STUB_FLAGS & TRAPF_SYSENTER) +#if (TRAP_STUB_FLAGS & TRAPF_FASTSYSCALL) mov esp, ss:[KIP0PCRADDRESS + offset KPCR.TSS] mov esp, KTSS.Esp0[esp] // sub esp, dword ptr offset KTRAP_FRAME.V86Es @@ -37,7 +40,7 @@ #if !(TRAP_STUB_FLAGS & TRAPF_NOSAVESEG) mov KTRAP_FRAME.SegDs[esp], ds mov KTRAP_FRAME.SegEs[esp], es -#if !(TRAP_STUB_FLAGS & TRAPF_NOSAVEFS) +#if (TRAP_STUB_FLAGS & TRAPF_SAVEFS) mov KTRAP_FRAME.SegFs[esp], fs #endif #if !(TRAP_STUB_FLAGS & TRAPF_NOLOADDS) @@ -57,23 +60,16 @@ mov KTRAP_FRAME.Edi[esp], edi #endif -#if (TRAP_STUB_FLAGS & TRAPF_VECTOR) -:scadr: - mov edx, 0 - call edx -#endif // call handler mov ecx, esp +#if (TRAP_STUB_FLAGS & TRAPF_INTERRUPT) + mov edx, TRAP_STUB_PARAM2 + call PKINTERRUPT.DispatchAddress[edx] +#else call TRAP_STUB_NAMEH +#endif - _ASM_END - - // asmcall(TRAP_STUB_NAMEH); - // call TRAP_STUB_NAMEH - // call HandlerName - - _ASM_BEGIN - // return + // restore regs #if (TRAP_STUB_FLAGS & TRAPF_SAVENOVOL) mov ebp, KTRAP_FRAME.Ebp[esp] mov ebx, KTRAP_FRAME.Ebx[esp] @@ -84,12 +80,21 @@ #if !(TRAP_STUB_FLAGS & TRAPF_NOSAVESEG) mov ds, KTRAP_FRAME.SegDs[esp] mov es, KTRAP_FRAME.SegEs[esp] -#if !(TRAP_STUB_FLAGS & TRAPF_NOSAVEFS) +#if (TRAP_STUB_FLAGS & TRAPF_SAVEFS) mov fs, KTRAP_FRAME.SegFs[esp] #endif #endif + // restore volatle regs and return mov eax, KTRAP_FRAME.Eax[esp] + +#if (TRAP_STUB_FLAGS & TRAPF_FASTSYSCALL) + mov ecx, KTRAP_FRAME.HardwareEsp[esp] + mov edx, KTRAP_FRAME.Eip[esp] + add esp, dword ptr offset KTRAP_FRAME.V86Es + sti + sysexit +#endif mov ecx, KTRAP_FRAME.Ecx[esp] mov edx, KTRAP_FRAME.Edx[esp] iretd Modified: branches/jcatena-branch/ntoskrnl/trap/trap.c URL:
http://svn.reactos.org/svn/reactos/branches/jcatena-branch/ntoskrnl/trap/tr…
============================================================================== --- branches/jcatena-branch/ntoskrnl/trap/trap.c [iso-8859-1] (original) +++ branches/jcatena-branch/ntoskrnl/trap/trap.c [iso-8859-1] Wed Feb 3 14:25:03 2010 @@ -129,7 +129,7 @@ // #define TRAP_STUB_NAME KiFastCallEntry -#define TRAP_STUB_FLAGS TRAPF_SYSENTER +#define TRAP_STUB_FLAGS TRAPF_FASTSYSCALL #include <TrapStub.h> #define TRAP_STUB_NAME KiInterruptTemplate @@ -140,6 +140,5 @@ VOID _FASTCALL init(void) { - void *t = scadr; } Modified: branches/jcatena-branch/ntoskrnl/trap/trap.h URL:
http://svn.reactos.org/svn/reactos/branches/jcatena-branch/ntoskrnl/trap/tr…
============================================================================== --- branches/jcatena-branch/ntoskrnl/trap/trap.h [iso-8859-1] (original) +++ branches/jcatena-branch/ntoskrnl/trap/trap.h [iso-8859-1] Wed Feb 3 14:25:03 2010 @@ -1,14 +1,14 @@ _ONCE -#define TRAPF_NOSAVESEG 1 -#define TRAPF_NOSAVEFS 2 -#define TRAPF_SAVENOVOL 4 -#define TRAPF_VECTOR 0x100 -#define TRAPF_ERRORCODE 0x200 -#define TRAPF_SYSENTER 0x400 - -extern KPCR const *TrapPcr; +// TRAP_STUB_FLAGS TrapStub x-macro flags +// trap type +#define TRAPF_ERRORCODE 1 +#define TRAPF_INTERRUPT 2 +#define TRAPF_FASTSYSCALL 4 +// options +#define TRAPF_NOSAVESEG 0x100 +#define TRAPF_SAVEFS 0x200 +#define TRAPF_SAVENOVOL 0x400 +#define TRAPF_NOLOADDS 0x800 #include <trap_asm.h> - -
14 years, 10 months
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
37
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
Results per page:
10
25
50
100
200