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
June 2011
----- 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
25 participants
460 discussions
Start a n
N
ew thread
[tkreuzer] 52142: Fix build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jun 7 22:54:43 2011 New Revision: 52142 URL:
http://svn.reactos.org/svn/reactos?rev=52142&view=rev
Log: Fix build Modified: trunk/reactos/tools/pecoff.h Modified: trunk/reactos/tools/pecoff.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/pecoff.h?rev=52142&r…
============================================================================== --- trunk/reactos/tools/pecoff.h [iso-8859-1] (original) +++ trunk/reactos/tools/pecoff.h [iso-8859-1] Tue Jun 7 22:54:43 2011 @@ -209,6 +209,10 @@ } IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION; #pragma pack(pop) +#ifndef UNALIGNED +#define UNALIGNED +#endif + #pragma pack(push,2) typedef struct _IMAGE_RELOCATION { union {
13 years, 6 months
1
0
0
0
[tkreuzer] 52141: [OBJ2BIN] - Implement coff relocation
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jun 7 22:45:56 2011 New Revision: 52141 URL:
http://svn.reactos.org/svn/reactos?rev=52141&view=rev
Log: [OBJ2BIN] - Implement coff relocation Modified: trunk/reactos/tools/obj2bin/obj2bin.c trunk/reactos/tools/pecoff.h Modified: trunk/reactos/tools/obj2bin/obj2bin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/obj2bin/obj2bin.c?re…
============================================================================== --- trunk/reactos/tools/obj2bin/obj2bin.c [iso-8859-1] (original) +++ trunk/reactos/tools/obj2bin/obj2bin.c [iso-8859-1] Tue Jun 7 22:45:56 2011 @@ -11,18 +11,54 @@ "Syntax: obj2bin <source file> <dest file>\n"); } +static +void +RelocateImage( + char *pData, + PIMAGE_RELOCATION pReloc, + unsigned int cNumRelocs, + PIMAGE_SYMBOL pSymbols, + unsigned int iOffset) +{ + unsigned int i; + WORD *p16; + + for (i = 0; i < cNumRelocs; i++) + { + switch (pReloc->Type) + { + case IMAGE_REL_I386_ABSOLUTE: + p16 = (void*)(pData + pReloc->VirtualAddress); + *p16 = (WORD)(pSymbols[pReloc->SymbolTableIndex].Value + iOffset); + break; + + default: + printf("Unknown relocatation type %ld\n", pReloc->Type); + } + + pReloc++; + } +} + int main(int argc, char *argv[]) { char *pszSourceFile; char *pszDestFile; + unsigned long iOffset; FILE *pSourceFile, *pDestFile; IMAGE_FILE_HEADER FileHeader; IMAGE_SECTION_HEADER SectionHeader; unsigned int i; size_t nSize; void *pData; - - if ((argc != 3) || (strcmp(argv[1], "--help") == 0)) Usage(); + PIMAGE_RELOCATION pReloc; + PIMAGE_SYMBOL pSymbols; + + if ((argc != 4) || (strcmp(argv[1], "--help") == 0)) + { + Usage(); + return -1; + } pszSourceFile = argv[1]; pszDestFile = argv[2]; @@ -40,6 +76,8 @@ fprintf(stderr, "Couldn't open dest file '%s'\n", pszDestFile); return -2; } + + iOffset = strtol(argv[3], 0, 16); /* Load the coff header */ nSize = fread(&FileHeader, 1, sizeof(FileHeader), pSourceFile); @@ -77,11 +115,34 @@ return -6; } - /* Move file pointer to the start of the section*/ + /* Move file pointer to the symbol table */ + if (fseek(pSourceFile, FileHeader.PointerToSymbolTable, SEEK_SET)) + { + fprintf(stderr, "Failed to set file pointer\n"); + return -7; + } + + /* Allocate memory for the symbols */ + nSize = FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL); + pSymbols = malloc(nSize); + if (!pSymbols) + { + fprintf(stderr, "Failed to allocate %ld bytes\n", nSize); + return -8; + } + + /* Read symbol data */ + if (!fread(pSymbols, nSize, 1, pSourceFile)) + { + fprintf(stderr, "Failed to read section %ld file\n", i); + return -9; + } + + /* Move file pointer to the start of the section */ if (fseek(pSourceFile, SectionHeader.PointerToRawData, SEEK_SET)) { fprintf(stderr, "Failed to set file pointer\n"); - return -7; + return -10; } /* Allocate memory for the section */ @@ -89,21 +150,46 @@ if (!pData) { fprintf(stderr, "Failed to allocate %ld bytes\n", SectionHeader.SizeOfRawData); - return -8; + return -11; } /* Read section data */ if (!fread(pData, SectionHeader.SizeOfRawData, 1, pSourceFile)) { fprintf(stderr, "Failed to read section %ld file\n", i); - return -5; - } + return -12; + } + + /* Allocate memory for the relocation */ + nSize = SectionHeader.NumberOfRelocations * sizeof(IMAGE_RELOCATION); + pReloc = malloc(nSize); + if (!pReloc) + { + fprintf(stderr, "Failed to allocate %ld bytes\n", nSize); + return -13; + } + + /* Move file pointer to the relocation table */ + if (fseek(pSourceFile, SectionHeader.PointerToRelocations, SEEK_SET)) + { + fprintf(stderr, "Failed to set file pointer\n"); + return -14; + } + + /* Read relocation data */ + if (!fread(pReloc, nSize, 1, pSourceFile)) + { + fprintf(stderr, "Failed to read section %ld file\n", i); + return -15; + } + + RelocateImage(pData, pReloc, SectionHeader.NumberOfRelocations, pSymbols, iOffset); /* Write the section to the destination file */ if (!fwrite(pData, SectionHeader.SizeOfRawData, 1, pDestFile)) { fprintf(stderr, "Failed to write data\n"); - return -9; + return -16; } fclose(pDestFile); Modified: trunk/reactos/tools/pecoff.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/pecoff.h?rev=52141&r…
============================================================================== --- trunk/reactos/tools/pecoff.h [iso-8859-1] (original) +++ trunk/reactos/tools/pecoff.h [iso-8859-1] Tue Jun 7 22:45:56 2011 @@ -41,11 +41,15 @@ #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 +#define IMAGE_REL_I386_ABSOLUTE 0x0001 + typedef unsigned char BYTE; typedef unsigned char UCHAR; typedef unsigned short WORD; +typedef short SHORT; typedef unsigned short USHORT; typedef unsigned long long ULONGLONG; + #if defined(__x86_64__) && !defined(_WIN64) typedef signed int LONG; typedef unsigned int ULONG; @@ -205,3 +209,33 @@ } IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION; #pragma pack(pop) +#pragma pack(push,2) +typedef struct _IMAGE_RELOCATION { + union { + DWORD VirtualAddress; + DWORD RelocCount; + }; + DWORD SymbolTableIndex; + WORD Type; +} IMAGE_RELOCATION; +typedef struct _IMAGE_RELOCATION UNALIGNED *PIMAGE_RELOCATION; +#pragma pack(pop) + +#pragma pack(push,2) +typedef struct _IMAGE_SYMBOL { + union { + BYTE ShortName[8]; + struct { + DWORD Short; + DWORD Long; + } Name; + DWORD LongName[2]; + } N; + DWORD Value; + SHORT SectionNumber; + WORD Type; + BYTE StorageClass; + BYTE NumberOfAuxSymbols; +} IMAGE_SYMBOL; +typedef struct _IMAGE_SYMBOL UNALIGNED *PIMAGE_SYMBOL; +#pragma pack(pop)
13 years, 6 months
1
0
0
0
[rharabien] 52140: [WIN32K] - Ops, remove DbgBreakPoint
by rharabien@svn.reactos.org
Author: rharabien Date: Tue Jun 7 20:52:09 2011 New Revision: 52140 URL:
http://svn.reactos.org/svn/reactos?rev=52140&view=rev
Log: [WIN32K] - Ops, remove DbgBreakPoint Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Tue Jun 7 20:52:09 2011 @@ -126,7 +126,6 @@ /* Remove the cursor */ GreMovePointer(hdcScreen, -1, -1); DPRINT("Removing pointer!\n"); - DbgBreakPoint(); } IntGetSysCursorInfo()->CurrentCursorObject = NewCursor; }
13 years, 6 months
1
0
0
0
[rharabien] 52139: - Silence unwanted debug messages added in r52136
by rharabien@svn.reactos.org
Author: rharabien Date: Tue Jun 7 20:46:32 2011 New Revision: 52139 URL:
http://svn.reactos.org/svn/reactos?rev=52139&view=rev
Log: - Silence unwanted debug messages added in r52136 Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Tue Jun 7 20:46:32 2011 @@ -125,7 +125,7 @@ { /* Remove the cursor */ GreMovePointer(hdcScreen, -1, -1); - DPRINT1("Removing pointer!\n"); + DPRINT("Removing pointer!\n"); DbgBreakPoint(); } IntGetSysCursorInfo()->CurrentCursorObject = NewCursor; @@ -172,13 +172,13 @@ { /* Show the pointer */ GreMovePointer(hdcScreen, gpsi->ptCursor.x, gpsi->ptCursor.y); - DPRINT1("Showing pointer!\n"); + DPRINT("Showing pointer!\n"); } else { /* Remove the pointer */ GreMovePointer(hdcScreen, -1, -1); - DPRINT1("Removing pointer!\n"); + DPRINT("Removing pointer!\n"); } /* Update global info */
13 years, 6 months
1
0
0
0
[cmihail] 52138: [TCPIP] Patches by cgutman applied to the branch (see r52125, r52092, r52086, r52083, r52013)
by cmihail@svn.reactos.org
Author: cmihail Date: Tue Jun 7 20:24:54 2011 New Revision: 52138 URL:
http://svn.reactos.org/svn/reactos?rev=52138&view=rev
Log: [TCPIP] Patches by cgutman applied to the branch (see r52125, r52092, r52086, r52083, r52013) Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/connect.c branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/listen.c branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/lock.c branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/main.c branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/tdi.c branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/tdiconn.c branches/GSoC_2011/TcpIpDriver/drivers/network/afd/include/afd.h branches/GSoC_2011/TcpIpDriver/drivers/network/afd/include/tdiconn.h branches/GSoC_2011/TcpIpDriver/drivers/network/ndis/ndis/miniport.c branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/include/titypes.h branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/tcpip/dispatch.c branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/tcpip/fileobjs.c branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/connect.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/connect.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/connect.c [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -427,10 +427,10 @@ case SOCKET_STATE_CONNECTING: return LeaveIrpUntilLater( FCB, Irp, FUNCTION_CONNECT ); - case SOCKET_STATE_CREATED: - if( FCB->LocalAddress ) ExFreePool( FCB->LocalAddress ); - FCB->LocalAddress = - TaCopyTransportAddress( &ConnectReq->RemoteAddress ); + case SOCKET_STATE_CREATED: + if( FCB->LocalAddress ) ExFreePool( FCB->LocalAddress ); + FCB->LocalAddress = + TaBuildNullTransportAddress( ConnectReq->RemoteAddress.Address[0].AddressType ); if( FCB->LocalAddress ) { Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/listen.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/listen.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/listen.c [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -117,10 +117,14 @@ PLIST_ENTRY NextIrpEntry, QeltEntry; PIRP NextIrp; + DbgPrint("[AFD, ListenComplete] Called\n"); + if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; FCB->ListenIrp.InFlightRequest = NULL; + + DbgPrint("[AFD, ListenComplete] FCB->State = 0x%x (should be 0x%x)\n", FCB->State, SOCKET_STATE_CLOSED); if( FCB->State == SOCKET_STATE_CLOSED ) { @@ -210,19 +214,30 @@ ListEntry ) ); } - if( FCB->ListenIrp.ConnectionCallInfo ) - { - ExFreePool( FCB->ListenIrp.ConnectionCallInfo ); - FCB->ListenIrp.ConnectionCallInfo = NULL; - } - - if( FCB->ListenIrp.ConnectionReturnInfo ) - { - ExFreePool( FCB->ListenIrp.ConnectionReturnInfo ); - FCB->ListenIrp.ConnectionReturnInfo = NULL; - } - - FCB->NeedsNewListen = TRUE; + /* Launch new accept socket */ + Status = WarmSocketForConnection( FCB ); + + if (NT_SUCCESS(Status)) + { + Status = TdiBuildNullConnectionInfoInPlace(FCB->ListenIrp.ConnectionCallInfo, + FCB->LocalAddress->Address[0].AddressType); + ASSERT(Status == STATUS_SUCCESS); + + Status = TdiBuildNullConnectionInfoInPlace(FCB->ListenIrp.ConnectionReturnInfo, + FCB->LocalAddress->Address[0].AddressType); + ASSERT(Status == STATUS_SUCCESS); + + Status = TdiListen( &FCB->ListenIrp.InFlightRequest, + FCB->Connection.Object, + &FCB->ListenIrp.ConnectionCallInfo, + &FCB->ListenIrp.ConnectionReturnInfo, + &FCB->ListenIrp.Iosb, + ListenComplete, + FCB ); + + if (Status == STATUS_PENDING) + Status = STATUS_SUCCESS; + } /* Trigger a select return if appropriate */ if( !IsListEmpty( &FCB->PendingConnections ) ) @@ -235,6 +250,8 @@ FCB->PollState &= ~AFD_EVENT_ACCEPT; SocketStateUnlock( FCB ); + + DbgPrint("[AFD, ListenComplete] Leaving. Status = 0x%x\n", Status); return Status; } @@ -305,9 +322,6 @@ if (Status == STATUS_PENDING) Status = STATUS_SUCCESS; - - if (NT_SUCCESS(Status)) - FCB->NeedsNewListen = FALSE; AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status)); DbgPrint("[AfdListenSocket] Returning %x\n", Status); @@ -377,54 +391,6 @@ if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); - if( FCB->NeedsNewListen ) - { - AFD_DbgPrint(MID_TRACE,("ADDRESSFILE: %x\n", FCB->AddressFile.Handle)); - DbgPrint("[AfdAccept] ADDRESSFILE: %x\n", FCB->AddressFile.Handle); - - /* Launch new accept socket */ - Status = WarmSocketForConnection( FCB ); - - if( Status == STATUS_SUCCESS ) - { - 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, - &FCB->ListenIrp.ConnectionCallInfo, - &FCB->ListenIrp.ConnectionReturnInfo, - &FCB->ListenIrp.Iosb, - ListenComplete, - FCB ); - - if( Status == STATUS_PENDING ) - Status = STATUS_SUCCESS; - - if( !NT_SUCCESS(Status) ) - return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); - - FCB->NeedsNewListen = FALSE; - } - else - return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); - } - for( PendingConn = FCB->PendingConnections.Flink; PendingConn != &FCB->PendingConnections; PendingConn = PendingConn->Flink ) Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/lock.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/lock.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/lock.c [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -123,7 +123,7 @@ AFD_DbgPrint(MID_TRACE,("Probe and lock pages\n")); _SEH2_TRY { MmProbeAndLockPages( MapBuf[i].Mdl, KernelMode, - Write ? IoModifyAccess : IoReadAccess ); + Write ? IoReadAccess : IoModifyAccess ); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { LockFailed = TRUE; } _SEH2_END; Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/main.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/main.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/main.c [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -381,6 +381,8 @@ UINT Function; PIRP CurrentIrp; + DbgPrint("[AFD, AfdCleanupSocket] Called\n"); + if( !SocketAcquireStateLock( FCB ) ) return LostSocket(Irp); for (Function = 0; Function < MAX_FUNCTIONS; Function++) @@ -400,6 +402,8 @@ KillSelectsForFCB( FCB->DeviceExt, FileObject, FALSE ); + DbgPrint("[AFD, AfdCleanupSocket] Leaving\n"); + return UnlockAndMaybeComplete(FCB, STATUS_SUCCESS, Irp, 0); } @@ -414,8 +418,12 @@ AFD_DbgPrint(MID_TRACE, ("AfdClose(DeviceObject %p Irp %p)\n", DeviceObject, Irp)); - - if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; + DbgPrint("[AfdCloseSocket] Called\n"); + + if( !SocketAcquireStateLock( FCB ) ) + return STATUS_FILE_CLOSED; + + DbgPrint("[AfdCloseSocket] Setting closed state\n"); FCB->State = SOCKET_STATE_CLOSED; FCB->PollState = AFD_EVENT_CLOSE; @@ -479,7 +487,10 @@ ExFreePool( FCB->RemoteAddress ); if( FCB->Connection.Object ) - ObDereferenceObject(FCB->Connection.Object); + { + TdiDisassociateAddressFile(FCB->Connection.Object); + ObDereferenceObject(FCB->Connection.Object); + } if( FCB->AddressFile.Object ) ObDereferenceObject(FCB->AddressFile.Object); @@ -510,6 +521,7 @@ IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); AFD_DbgPrint(MID_TRACE, ("Returning success.\n")); + DbgPrint("[AfdCloseSocket] Leaving\n"); return STATUS_SUCCESS; } Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/tdi.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/tdi.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/tdi.c [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -430,6 +430,55 @@ return Status; } +NTSTATUS TdiDisassociateAddressFile( + PFILE_OBJECT ConnectionObject) +/* + * FUNCTION: Disassociates a connection endpoint from an address file object + * ARGUMENTS: + * ConnectionObject = Connection endpoint file object + * RETURNS: + * Status of operation + */ +{ + PDEVICE_OBJECT DeviceObject; + IO_STATUS_BLOCK Iosb; + NTSTATUS Status; + KEVENT Event; + PIRP Irp; + + AFD_DbgPrint(MAX_TRACE, ("Called. ConnectionObject (0x%X)\n", ConnectionObject)); + + if (!ConnectionObject) { + AFD_DbgPrint(MIN_TRACE, ("Bad connection object.\n")); + return STATUS_INVALID_PARAMETER; + } + + DeviceObject = IoGetRelatedDeviceObject(ConnectionObject); + if (!DeviceObject) { + AFD_DbgPrint(MIN_TRACE, ("Bad device object.\n")); + return STATUS_INVALID_PARAMETER; + } + + KeInitializeEvent(&Event, NotificationEvent, FALSE); + + Irp = TdiBuildInternalDeviceControlIrp(TDI_DISASSOCIATE_ADDRESS, /* Sub function */ + DeviceObject, /* Device object */ + ConnectionObject, /* File object */ + &Event, /* Event */ + &Iosb); /* Status */ + if (!Irp) + return STATUS_INSUFFICIENT_RESOURCES; + + TdiBuildDisassociateAddress(Irp, + DeviceObject, + ConnectionObject, + NULL, + NULL); + + Status = TdiCall(Irp, DeviceObject, &Event, &Iosb); + + return Status; +} NTSTATUS TdiListen ( PIRP *Irp, @@ -1244,7 +1293,7 @@ } Irp = TdiBuildInternalDeviceControlIrp - ( TDI_SEND_DATAGRAM, /* Sub function */ + ( TDI_DISCONNECT, /* Sub function */ DeviceObject, /* Device object */ TransportObject, /* File object */ &Event, /* Event */ Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/tdiconn.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/tdiconn.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/afd/afd/tdiconn.c [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -38,7 +38,14 @@ } UINT TaLengthOfTransportAddress( PTRANSPORT_ADDRESS Addr ) { - UINT AddrLen = 2 * sizeof( ULONG ) + Addr->Address[0].AddressLength; + UINT AddrLen = sizeof(ULONG) + TaLengthOfAddress(&Addr->Address[0]); + AFD_DbgPrint(MID_TRACE,("AddrLen %x\n", AddrLen)); + return AddrLen; +} + +UINT TaLengthOfTransportAddressByType(UINT AddressType) +{ + UINT AddrLen = sizeof(ULONG) + 2 * sizeof(USHORT) + TdiAddressSizeFromType(AddressType); AFD_DbgPrint(MID_TRACE,("AddrLen %x\n", AddrLen)); return AddrLen; } @@ -77,7 +84,26 @@ return A; } -static NTSTATUS TdiBuildNullConnectionInfoInPlace +PTRANSPORT_ADDRESS TaBuildNullTransportAddress(UINT AddressType) +{ + UINT AddrLen; + PTRANSPORT_ADDRESS A; + + AddrLen = TaLengthOfTransportAddressByType(AddressType); + A = ExAllocatePool(NonPagedPool, AddrLen); + + if (A) + { + A->TAAddressCount = 1; + A->Address[0].AddressLength = TdiAddressSizeFromType(AddressType); + A->Address[0].AddressType = AddressType; + RtlZeroMemory(A->Address[0].Address, A->Address[0].AddressLength); + } + + return A; +} + +NTSTATUS TdiBuildNullConnectionInfoInPlace ( PTDI_CONNECTION_INFORMATION ConnInfo, ULONG Type ) /* Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/afd/include/afd.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/afd/include/afd.h [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/afd/include/afd.h [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -179,7 +179,7 @@ PVOID CurrentThread; PFILE_OBJECT FileObject; PAFD_DEVICE_EXTENSION DeviceExt; - BOOLEAN DelayedAccept, NeedsNewListen; + BOOLEAN DelayedAccept; UINT ConnSeq; PTRANSPORT_ADDRESS LocalAddress, RemoteAddress; PTDI_CONNECTION_INFORMATION AddressFrom, ConnectInfo; @@ -360,6 +360,9 @@ HANDLE AddressHandle, PFILE_OBJECT ConnectionObject); +NTSTATUS TdiDisassociateAddressFile( + PFILE_OBJECT ConnectionObject); + NTSTATUS TdiListen ( PIRP *Irp, PFILE_OBJECT ConnectionObject, Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/afd/include/tdiconn.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/afd/include/tdiconn.h [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/afd/include/tdiconn.h [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -7,6 +7,7 @@ typedef VOID *PTDI_CONNECTION_INFO_PAIR; PTRANSPORT_ADDRESS TaCopyTransportAddress( PTRANSPORT_ADDRESS OtherAddress ); +PTRANSPORT_ADDRESS TaBuildNullTransportAddress(UINT AddressType); UINT TaLengthOfAddress( PTA_ADDRESS Addr ); UINT TaLengthOfTransportAddress( PTRANSPORT_ADDRESS Addr ); VOID TaCopyAddressInPlace( PTA_ADDRESS Target, PTA_ADDRESS Source ); @@ -19,7 +20,7 @@ ( PTDI_CONNECTION_INFORMATION ConnInfo, PTRANSPORT_ADDRESS Name ); NTSTATUS TdiBuildConnectionInfo ( PTDI_CONNECTION_INFORMATION *ConnectionInfo, PTRANSPORT_ADDRESS Name ); -NTSTATUS TdiBuildNullConnectionInfoToPlace +NTSTATUS TdiBuildNullConnectionInfoInPlace ( PTDI_CONNECTION_INFORMATION ConnInfo, ULONG Type ); NTSTATUS TdiBuildNullConnectionInfo ( PTDI_CONNECTION_INFORMATION *ConnectionInfo, ULONG Type ); Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -1880,6 +1880,7 @@ { NDIS_DbgPrint(MIN_TRACE, ("Failed to open configuration key\n")); ExInterlockedRemoveEntryList( &Adapter->ListEntry, &AdapterListLock ); + NdisCloseConfiguration(ConfigHandle); return NdisStatus; } @@ -2218,48 +2219,54 @@ NDIS_DbgPrint(MIN_TRACE, ("Lower driver failed device start\n")); Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); - break; + return Status; case IRP_MN_STOP_DEVICE: - Status = NdisIForwardIrpAndWait(Adapter, Irp); - if (NT_SUCCESS(Status) && NT_SUCCESS(Irp->IoStatus.Status)) - { - Status = NdisIPnPStopDevice(DeviceObject, Irp); - } - else - NDIS_DbgPrint(MIN_TRACE, ("Lower driver failed device stop\n")); - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + Status = NdisIPnPStopDevice(DeviceObject, Irp); + if (!NT_SUCCESS(Status)) + NDIS_DbgPrint(MIN_TRACE, ("WARNING: Ignoring halt device failure! Passing the IRP down anyway\n")); + Irp->IoStatus.Status = STATUS_SUCCESS; break; case IRP_MN_QUERY_REMOVE_DEVICE: case IRP_MN_QUERY_STOP_DEVICE: Status = NdisIPnPQueryStopDevice(DeviceObject, Irp); Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + if (Status != STATUS_SUCCESS) + { + IoCompleteRequest(Irp, IO_NO_INCREMENT); + NDIS_DbgPrint(MIN_TRACE, ("Failing miniport halt request\n")); + return Status; + } break; case IRP_MN_CANCEL_REMOVE_DEVICE: case IRP_MN_CANCEL_STOP_DEVICE: - Status = NdisIPnPCancelStopDevice(DeviceObject, Irp); + Status = NdisIForwardIrpAndWait(Adapter, Irp); + if (NT_SUCCESS(Status) && NT_SUCCESS(Irp->IoStatus.Status)) + { + Status = NdisIPnPCancelStopDevice(DeviceObject, Irp); + } + else + { + NDIS_DbgPrint(MIN_TRACE, ("Lower driver failed cancel stop/remove request\n")); + } Irp->IoStatus.Status = Status; IoCompleteRequest(Irp, IO_NO_INCREMENT); - break; + return Status; case IRP_MN_QUERY_PNP_DEVICE_STATE: Status = NDIS_STATUS_SUCCESS; Irp->IoStatus.Status = Status; Irp->IoStatus.Information |= Adapter->NdisMiniportBlock.PnPFlags; - IoCompleteRequest(Irp, IO_NO_INCREMENT); break; default: - IoSkipCurrentIrpStackLocation(Irp); - Status = IoCallDriver(Adapter->NdisMiniportBlock.NextDeviceObject, Irp); break; } - return Status; + IoSkipCurrentIrpStackLocation(Irp); + return IoCallDriver(Adapter->NdisMiniportBlock.NextDeviceObject, Irp); } Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/include/titypes.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/include/titypes.h [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/include/titypes.h [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -268,6 +268,8 @@ LIST_ENTRY ListenRequest; /* Queued listen requests */ LIST_ENTRY ReceiveRequest; /* Queued receive requests */ LIST_ENTRY SendRequest; /* Queued send requests */ + + struct _CONNECTION_ENDPOINT *Next; /* Next connection in address file list */ } CONNECTION_ENDPOINT, *PCONNECTION_ENDPOINT; Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/tcpip/dispatch.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -209,6 +209,7 @@ IoReleaseCancelSpinLock(Irp->CancelIrql); TI_DbgPrint(DEBUG_IRP, ("Called.\n")); + DbgPrint("[TCPIP, DispCancelListenRequest] Called\n"); IrpSp = IoGetCurrentIrpStackLocation(Irp); FileObject = IrpSp->FileObject; @@ -219,7 +220,10 @@ #if DBG if (!Irp->Cancel) + { TI_DbgPrint(MIN_TRACE, ("Irp->Cancel is FALSE, should be TRUE.\n")); + DbgPrint("[TCPIP, DispCancelListenRequest] Irp->Cancel is FALSE, should be TRUE\n"); + } #endif /* Try canceling the request */ @@ -233,6 +237,7 @@ } TI_DbgPrint(MAX_TRACE, ("Leaving.\n")); + DbgPrint("[TCPIP, DispCancelListenRequest] Leaving\n"); } @@ -262,14 +267,14 @@ * Status of operation */ { - PTDI_REQUEST_KERNEL_ASSOCIATE Parameters; - PTRANSPORT_CONTEXT TranContext; - PIO_STACK_LOCATION IrpSp; - PCONNECTION_ENDPOINT Connection; - PFILE_OBJECT FileObject; - PADDRESS_FILE AddrFile = NULL; - NTSTATUS Status; - KIRQL OldIrql; + PTDI_REQUEST_KERNEL_ASSOCIATE Parameters; + PTRANSPORT_CONTEXT TranContext; + PIO_STACK_LOCATION IrpSp; + PCONNECTION_ENDPOINT Connection, LastConnection; + PFILE_OBJECT FileObject; + PADDRESS_FILE AddrFile = NULL; + NTSTATUS Status; + KIRQL OldIrql; TI_DbgPrint(DEBUG_IRP, ("[TCPIP, DispTdiAssociateAddress] Called\n")); @@ -349,20 +354,27 @@ LockObjectAtDpcLevel(AddrFile); + /* Add connection endpoint to the address file */ + ReferenceObject(Connection); + if (AddrFile->Connection == NULL) + AddrFile->Connection = Connection; + else + { + LastConnection = AddrFile->Connection; + while (LastConnection->Next != NULL) + LastConnection = LastConnection->Next; + LastConnection->Next = Connection; + } + ReferenceObject(AddrFile); Connection->AddressFile = AddrFile; - /* Add connection endpoint to the address file */ - ReferenceObject(Connection); - AddrFile->Connection = Connection; - - /* FIXME: Maybe do this in DispTdiDisassociateAddress() instead? */ - ObDereferenceObject(FileObject); - UnlockObjectFromDpcLevel(AddrFile); UnlockObject(Connection, OldIrql); - return Status; + ObDereferenceObject(FileObject); + + return STATUS_SUCCESS; } @@ -440,10 +452,11 @@ * Status of operation */ { - PCONNECTION_ENDPOINT Connection; + PCONNECTION_ENDPOINT Connection, LastConnection; PTRANSPORT_CONTEXT TranContext; PIO_STACK_LOCATION IrpSp; KIRQL OldIrql; + NTSTATUS Status; TI_DbgPrint(DEBUG_IRP, ("Called.\n")); @@ -473,19 +486,42 @@ LockObjectAtDpcLevel(Connection->AddressFile); - /* Remove this connection from the address file */ - DereferenceObject(Connection->AddressFile->Connection); - Connection->AddressFile->Connection = NULL; + /* Unlink this connection from the address file */ + if (Connection->AddressFile->Connection == Connection) + { + Connection->AddressFile->Connection = Connection->Next; + DereferenceObject(Connection); + Status = STATUS_SUCCESS; + } + else + { + LastConnection = Connection->AddressFile->Connection; + while (LastConnection->Next != Connection && LastConnection->Next != NULL) + LastConnection = LastConnection->Next; + if (LastConnection->Next == Connection) + { + LastConnection->Next = Connection->Next; + DereferenceObject(Connection); + Status = STATUS_SUCCESS; + } + else + { + Status = STATUS_INVALID_PARAMETER; + } + } UnlockObjectFromDpcLevel(Connection->AddressFile); - /* Remove the address file from this connection */ - DereferenceObject(Connection->AddressFile); - Connection->AddressFile = NULL; + if (Status == STATUS_SUCCESS) + { + /* Remove the address file from this connection */ + DereferenceObject(Connection->AddressFile); + Connection->AddressFile = NULL; + } UnlockObject(Connection, OldIrql); - return STATUS_SUCCESS; + return Status; } @@ -618,12 +654,11 @@ if( !Connection->AddressFile->Listener ) Status = STATUS_NO_MEMORY; - if( NT_SUCCESS(Status) ) - { - ReferenceObject(Connection->AddressFile); - Connection->AddressFile->Listener->AddressFile = Connection->AddressFile; - - Status = TCPSocket( Connection->AddressFile->Listener, + if( NT_SUCCESS(Status) ) { + Connection->AddressFile->Listener->AddressFile = + Connection->AddressFile; + + Status = TCPSocket( Connection->AddressFile->Listener, Connection->AddressFile->Family, SOCK_STREAM, Connection->AddressFile->Protocol ); Modified: branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/tcpip/fileobjs.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/drivers/n…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -161,6 +161,9 @@ TI_DbgPrint(MID_TRACE, ("Called.\n")); + /* We should not be associated with a connection here */ + ASSERT(!AddrFile->Connection); + /* Remove address file from the global list */ TcpipAcquireSpinLock(&AddressFileListLock, &OldIrql); RemoveEntryList(&AddrFile->ListEntry); @@ -377,17 +380,14 @@ if (!Request->Handle.AddressHandle) return STATUS_INVALID_PARAMETER; LockObject(AddrFile, &OldIrql); - /* We have to close this connection because we started it */ + + /* We have to close this listener because we started it */ if( AddrFile->Listener ) { AddrFile->Listener->AddressFile = NULL; TCPClose( AddrFile->Listener ); } - if( AddrFile->Connection ) - { - AddrFile->Connection->AddressFile = NULL; - DereferenceObject( AddrFile->Connection ); - } + UnlockObject(AddrFile, OldIrql); DereferenceObject(AddrFile); Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/drive…
============================================================================== --- branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] (original) +++ branches/GSoC_2011/TcpIpDriver/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Tue Jun 7 20:24:54 2011 @@ -342,12 +342,13 @@ { KIRQL OldIrql; PVOID Socket; - PADDRESS_FILE AddressFile = NULL; - PCONNECTION_ENDPOINT AddressConnection = NULL; LockObject(Connection, &OldIrql); Socket = Connection->SocketContext; Connection->SocketContext = NULL; + + /* We should not be associated to an address file at this point */ + ASSERT(!Connection->AddressFile); /* Don't try to close again if the other side closed us already */ if (Socket) @@ -357,27 +358,9 @@ FlushAllQueues(Connection, STATUS_CANCELLED); } - if (Connection->AddressFile) - { - LockObjectAtDpcLevel(Connection->AddressFile); - if (Connection->AddressFile->Connection == Connection) - { - AddressConnection = Connection->AddressFile->Connection; - Connection->AddressFile->Connection = NULL; - } - UnlockObjectFromDpcLevel(Connection->AddressFile); - - AddressFile = Connection->AddressFile; - Connection->AddressFile = NULL; - } - UnlockObject(Connection, OldIrql); DereferenceObject(Connection); - if (AddressConnection) - DereferenceObject(AddressConnection); - if (AddressFile) - DereferenceObject(AddressFile); return STATUS_SUCCESS; }
13 years, 6 months
1
0
0
0
[tkreuzer] 52137: [OBJ2BIN] - Fix warnings
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jun 7 20:16:52 2011 New Revision: 52137 URL:
http://svn.reactos.org/svn/reactos?rev=52137&view=rev
Log: [OBJ2BIN] - Fix warnings Modified: trunk/reactos/tools/obj2bin/obj2bin.c Modified: trunk/reactos/tools/obj2bin/obj2bin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/obj2bin/obj2bin.c?re…
============================================================================== --- trunk/reactos/tools/obj2bin/obj2bin.c [iso-8859-1] (original) +++ trunk/reactos/tools/obj2bin/obj2bin.c [iso-8859-1] Tue Jun 7 20:16:52 2011 @@ -1,5 +1,6 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #include "../pecoff.h" static @@ -17,7 +18,8 @@ FILE *pSourceFile, *pDestFile; IMAGE_FILE_HEADER FileHeader; IMAGE_SECTION_HEADER SectionHeader; - unsigned int i, nSize; + unsigned int i; + size_t nSize; void *pData; if ((argc != 3) || (strcmp(argv[1], "--help") == 0)) Usage();
13 years, 6 months
1
0
0
0
[rharabien] 52136: - Add ShowingCursor counter and CursorObject to message queue and use them when moving mouse. They are not globally in Windows.
by rharabien@svn.reactos.org
Author: rharabien Date: Tue Jun 7 20:12:56 2011 New Revision: 52136 URL:
http://svn.reactos.org/svn/reactos?rev=52136&view=rev
Log: - Add ShowingCursor counter and CursorObject to message queue and use them when moving mouse. They are not globally in Windows. Modified: trunk/reactos/subsystems/win32/win32k/include/cursoricon.h trunk/reactos/subsystems/win32/win32k/include/msgqueue.h trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c trunk/reactos/subsystems/win32/win32k/ntuser/display.c trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c Modified: trunk/reactos/subsystems/win32/win32k/include/cursoricon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/cursoricon.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/cursoricon.h [iso-8859-1] Tue Jun 7 20:12:56 2011 @@ -71,8 +71,6 @@ BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook); -int UserShowCursor(BOOL bShow); - PSYSTEM_CURSORINFO IntGetSysCursorInfo(VOID); #define IntReleaseCurIconObject(CurIconObj) \ Modified: trunk/reactos/subsystems/win32/win32k/include/msgqueue.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] Tue Jun 7 20:12:56 2011 @@ -1,6 +1,7 @@ #pragma once #include "hook.h" +#include "cursoricon.h" #define MSQ_HUNG 5000 #define MSQ_NORMAL 0 @@ -59,8 +60,6 @@ LIST_ENTRY PostedMessagesListHead; /* Queue for hardware messages for the queue. */ LIST_ENTRY HardwareMessagesListHead; - /* Lock for the hardware message list. */ - KMUTEX HardwareLock; /* True if a WM_MOUSEMOVE is pending */ BOOLEAN MouseMoved; /* Current WM_MOUSEMOVE message */ @@ -111,6 +110,11 @@ /* state of each key */ UCHAR KeyState[256]; + /* showing cursor counter (value>=0 - cursor visible, value<0 - cursor hidden) */ + INT ShowingCursor; + /* cursor object */ + PCURICON_OBJECT CursorObject; + /* messages that are currently dispatched by other threads */ LIST_ENTRY DispatchingMessagesHead; /* messages that are currently dispatched by this message queue, required for cleanup */ @@ -322,4 +326,10 @@ VOID FASTCALL MsqWakeQueue(PUSER_MESSAGE_QUEUE,DWORD,BOOL); VOID FASTCALL ClearMsgBitsMask(PUSER_MESSAGE_QUEUE,UINT); +int UserShowCursor(BOOL bShow); +PCURICON_OBJECT +FASTCALL +UserSetCursor(PCURICON_OBJECT NewCursor, + BOOL ForceChange); + /* EOF */ Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] Tue Jun 7 20:12:56 2011 @@ -99,79 +99,13 @@ return CurIcon; } -PCURICON_OBJECT -FASTCALL -UserSetCursor( - PCURICON_OBJECT NewCursor, - BOOL ForceChange) -{ - PSYSTEM_CURSORINFO CurInfo; - PCURICON_OBJECT OldCursor; - HDC hdcScreen; - - CurInfo = IntGetSysCursorInfo(); - - OldCursor = CurInfo->CurrentCursorObject; - - /* Is the new cursor the same as the old cursor? */ - if (OldCursor == NewCursor) - { - /* Nothing to to do in this case */ - return OldCursor; - } - - /* Get the screen DC */ - if(!(hdcScreen = IntGetScreenDC())) - { - return (HCURSOR)0; - } - - /* Do we have a new cursor? */ - if (NewCursor) - { - CurInfo->ShowingCursor = 0; - CurInfo->CurrentCursorObject = NewCursor; - - /* Call GDI to set the new screen cursor */ - GreSetPointerShape(hdcScreen, - NewCursor->IconInfo.hbmMask, - NewCursor->IconInfo.hbmColor, - NewCursor->IconInfo.xHotspot, - NewCursor->IconInfo.yHotspot, - gpsi->ptCursor.x, - gpsi->ptCursor.y); - } - else - { - /* Check if were diplaying a cursor */ - if (OldCursor && CurInfo->ShowingCursor >= 0) - { - /* Remove the cursor */ - GreMovePointer(hdcScreen, -1, -1); - DPRINT("Removing pointer!\n"); - } - - CurInfo->CurrentCursorObject = NULL; - CurInfo->ShowingCursor = -1; - } - - /* Return the old cursor */ - return OldCursor; -} - BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook) { PWND DesktopWindow; PSYSTEM_CURSORINFO CurInfo; - HDC hDC; MSG Msg; RECTL rcClip; POINT pt; - - if(!(hDC = IntGetScreenDC())) - { - return FALSE; - } if(!(DesktopWindow = UserGetDesktopWindow())) { @@ -194,56 +128,17 @@ pt.x = x; pt.y = y; - /* 3. Generate a mouse move message, this sets the htEx and Track Window too. */ + /* 1. Generate a mouse move message, this sets the htEx and Track Window too. */ Msg.message = WM_MOUSEMOVE; Msg.wParam = CurInfo->ButtonsDown; Msg.lParam = MAKELPARAM(x, y); Msg.pt = pt; co_MsqInsertMouseMessage(&Msg, flags, dwExtraInfo, Hook); - /* 1. Store the new cursor position */ + /* 2. Store the new cursor position */ gpsi->ptCursor = pt; - /* 2. Move the mouse pointer */ - GreMovePointer(hDC, x, y); - return TRUE; -} - -/* Called from NtUserCallOneParam with Routine ONEPARAM_ROUTINE_SHOWCURSOR - * User32 macro NtUserShowCursor */ -int UserShowCursor(BOOL bShow) -{ - PSYSTEM_CURSORINFO CurInfo = IntGetSysCursorInfo(); - HDC hdcScreen; - - if (!(hdcScreen = IntGetScreenDC())) - { - return -1; /* No mouse */ - } - - if (bShow == FALSE) - { - /* Check if were diplaying a cursor */ - if (CurInfo->ShowingCursor == 0) - { - /* Remove the pointer */ - GreMovePointer(hdcScreen, -1, -1); - DPRINT("Removing pointer!\n"); - } - CurInfo->ShowingCursor--; - } - else - { - if (CurInfo->ShowingCursor == -1) - { - /*Show the pointer*/ - GreMovePointer(hdcScreen, gpsi->ptCursor.x, gpsi->ptCursor.y); - } - CurInfo->ShowingCursor++; - } - - return CurInfo->ShowingCursor; } /* Modified: trunk/reactos/subsystems/win32/win32k/ntuser/display.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] Tue Jun 7 20:12:56 2011 @@ -634,7 +634,6 @@ BOOL APIENTRY UserClipCursor(RECTL *prcl); VOID APIENTRY UserRedrawDesktop(); -HCURSOR FASTCALL UserSetCursor(PCURICON_OBJECT NewCursor, BOOL ForceChange); LONG APIENTRY Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Tue Jun 7 20:12:56 2011 @@ -41,6 +41,151 @@ 256); return(STATUS_SUCCESS); +} + +PWND FASTCALL +IntTopLevelWindowFromPoint(INT x, INT y) +{ + PWND pWnd, pwndDesktop; + + /* Get the desktop window */ + pwndDesktop = UserGetDesktopWindow(); + if (!pwndDesktop) + return NULL; + + /* Loop all top level windows */ + for (pWnd = pwndDesktop->spwndChild; + pWnd != NULL; + pWnd = pWnd->spwndNext) + { + if (pWnd->state2 & WNDS2_INDESTROY || pWnd->state & WNDS_DESTROYED) + { + DPRINT("The Window is in DESTROY!\n"); + continue; + } + + if ((pWnd->style & WS_VISIBLE) && IntPtInWindow(pWnd, x, y)) + return pWnd; + } + + /* Window has not been found */ + return NULL; +} + +PCURICON_OBJECT +FASTCALL +UserSetCursor( + PCURICON_OBJECT NewCursor, + BOOL ForceChange) +{ + PCURICON_OBJECT OldCursor; + HDC hdcScreen; + PTHREADINFO pti; + PUSER_MESSAGE_QUEUE MessageQueue; + PWND pWnd; + + pti = PsGetCurrentThreadWin32Thread(); + MessageQueue = pti->MessageQueue; + + /* Get the screen DC */ + if(!(hdcScreen = IntGetScreenDC())) + { + return (HCURSOR)0; + } + + OldCursor = MessageQueue->CursorObject; + + /* Check if cursors are different */ + if (OldCursor == NewCursor) + return OldCursor; + + /* Update cursor for this message queue */ + MessageQueue->CursorObject = NewCursor; + + /* If cursor is not visible we have nothing to do */ + if (MessageQueue->ShowingCursor < 0) + return OldCursor; + + /* Update cursor if this message queue controls it */ + pWnd = IntTopLevelWindowFromPoint(gpsi->ptCursor.x, gpsi->ptCursor.y); + if (pWnd && pWnd->head.pti->MessageQueue == MessageQueue) + { + if (NewCursor) + { + /* Call GDI to set the new screen cursor */ + GreSetPointerShape(hdcScreen, + NewCursor->IconInfo.hbmMask, + NewCursor->IconInfo.hbmColor, + NewCursor->IconInfo.xHotspot, + NewCursor->IconInfo.yHotspot, + gpsi->ptCursor.x, + gpsi->ptCursor.y); + } + else /* Note: OldCursor != NewCursor so we have to hide cursor */ + { + /* Remove the cursor */ + GreMovePointer(hdcScreen, -1, -1); + DPRINT1("Removing pointer!\n"); + DbgBreakPoint(); + } + IntGetSysCursorInfo()->CurrentCursorObject = NewCursor; + } + + /* Return the old cursor */ + return OldCursor; +} + +/* Called from NtUserCallOneParam with Routine ONEPARAM_ROUTINE_SHOWCURSOR + * User32 macro NtUserShowCursor */ +int UserShowCursor(BOOL bShow) +{ + HDC hdcScreen; + PTHREADINFO pti; + PUSER_MESSAGE_QUEUE MessageQueue; + PWND pWnd; + + if (!(hdcScreen = IntGetScreenDC())) + { + return -1; /* No mouse */ + } + + pti = PsGetCurrentThreadWin32Thread(); + MessageQueue = pti->MessageQueue; + + /* Update counter */ + MessageQueue->ShowingCursor += bShow ? 1 : -1; + + /* Check for trivial cases */ + if ((bShow && MessageQueue->ShowingCursor != 0) || + (!bShow && MessageQueue->ShowingCursor != -1)) + { + /* Note: w don't update global info here because it is used only + internally to check if cursor is visible */ + return MessageQueue->ShowingCursor; + } + + /* Check if cursor is above window owned by this MessageQueue */ + pWnd = IntTopLevelWindowFromPoint(gpsi->ptCursor.x, gpsi->ptCursor.y); + if (pWnd && pWnd->head.pti->MessageQueue == MessageQueue) + { + if (bShow) + { + /* Show the pointer */ + GreMovePointer(hdcScreen, gpsi->ptCursor.x, gpsi->ptCursor.y); + DPRINT1("Showing pointer!\n"); + } + else + { + /* Remove the pointer */ + GreMovePointer(hdcScreen, -1, -1); + DPRINT1("Removing pointer!\n"); + } + + /* Update global info */ + IntGetSysCursorInfo()->ShowingCursor = MessageQueue->ShowingCursor; + } + + return MessageQueue->ShowingCursor; } DWORD FASTCALL UserGetKeyState(DWORD key) @@ -307,13 +452,15 @@ MSLLHOOKSTRUCT MouseHookData; PDESKTOP pDesk; PWND pwnd, pwndDesktop; + HDC hdcScreen; + PSYSTEM_CURSORINFO CurInfo; KeQueryTickCount(&LargeTickCount); Msg->time = MsqCalculateMessageTime(&LargeTickCount); MouseHookData.pt.x = LOWORD(Msg->lParam); MouseHookData.pt.y = HIWORD(Msg->lParam); - switch(Msg->message) + switch (Msg->message) { case WM_MOUSEWHEEL: MouseHookData.mouseData = MAKELONG(0, GET_WHEEL_DELTA_WPARAM(Msg->wParam)); @@ -344,7 +491,7 @@ /* Get the desktop window */ pwndDesktop = UserGetDesktopWindow(); - if(!pwndDesktop) + if (!pwndDesktop) return; /* Set hit somewhere on the desktop */ @@ -354,7 +501,7 @@ /* Check if the mouse is captured */ Msg->hwnd = IntGetCaptureWindow(); - if(Msg->hwnd != NULL) + if (Msg->hwnd != NULL) { pwnd = UserGetWindowObject(Msg->hwnd); if ((pwnd->style & WS_VISIBLE) && @@ -366,41 +513,66 @@ } else { - /* Loop all top level windows to find which one should receive input */ - for( pwnd = pwndDesktop->spwndChild; - pwnd != NULL; - pwnd = pwnd->spwndNext ) + pwnd = IntTopLevelWindowFromPoint(Msg->pt.x, Msg->pt.y); + if (pwnd) { - if ( pwnd->state2 & WNDS2_INDESTROY || pwnd->state & WNDS_DESTROYED ) + Msg->hwnd = pwnd->head.h; + pDesk->htEx = HTCLIENT; + pDesk->spwndTrack = pwnd; + } + } + + hdcScreen = IntGetScreenDC(); + CurInfo = IntGetSysCursorInfo(); + + /* Check if we found a window */ + if (Msg->hwnd != NULL && pwnd != NULL) + { + if (Msg->message == WM_MOUSEMOVE) + { + PUSER_MESSAGE_QUEUE MessageQueue = pwnd->head.pti->MessageQueue; + + /* Check if cursor should be visible */ + if(hdcScreen && + MessageQueue->CursorObject && + MessageQueue->ShowingCursor >= 0) { - DPRINT("The Window is in DESTROY!\n"); - continue; + /* Check if shape has changed */ + if(CurInfo->CurrentCursorObject != MessageQueue->CursorObject) + { + /* Call GDI to set the new screen cursor */ + GreSetPointerShape(hdcScreen, + MessageQueue->CursorObject->IconInfo.hbmMask, + MessageQueue->CursorObject->IconInfo.hbmColor, + MessageQueue->CursorObject->IconInfo.xHotspot, + MessageQueue->CursorObject->IconInfo.yHotspot, + gpsi->ptCursor.x, + gpsi->ptCursor.y); + } else + GreMovePointer(hdcScreen, Msg->pt.x, Msg->pt.y); } - - if((pwnd->style & WS_VISIBLE) && - IntPtInWindow(pwnd, Msg->pt.x, Msg->pt.y)) - { - Msg->hwnd = pwnd->head.h; - pDesk->htEx = HTCLIENT; - pDesk->spwndTrack = pwnd; - break; - } - } - } - - /* Check if we found a window */ - if(Msg->hwnd != NULL && pwnd != NULL) - { - if(Msg->message == WM_MOUSEMOVE) - { - /* Mouse move is a special case*/ - MsqPostMouseMove(pwnd->head.pti->MessageQueue, Msg); + /* Check if w have to hide cursor */ + else if (CurInfo->ShowingCursor >= 0) + GreMovePointer(hdcScreen, -1, -1); + + /* Update global cursor info */ + CurInfo->ShowingCursor = MessageQueue->ShowingCursor; + CurInfo->CurrentCursorObject = MessageQueue->CursorObject; + + /* Mouse move is a special case */ + MsqPostMouseMove(MessageQueue, Msg); } else { DPRINT("Posting mouse message to hwnd=0x%x!\n", UserHMGetHandle(pwnd)); MsqPostMessage(pwnd->head.pti->MessageQueue, Msg, TRUE, QS_MOUSEBUTTON); } + } + else if (hdcScreen) + { + /* always show cursor on background; FIXME: set default pointer */ + GreMovePointer(hdcScreen, Msg->pt.x, Msg->pt.y); + CurInfo->ShowingCursor = 0; } /* Do GetMouseMovePointsEx FIFO. */ @@ -1601,13 +1773,14 @@ InitializeListHead(&MessageQueue->HardwareMessagesListHead); InitializeListHead(&MessageQueue->DispatchingMessagesHead); InitializeListHead(&MessageQueue->LocalDispatchingMessagesHead); - KeInitializeMutex(&MessageQueue->HardwareLock, 0); MessageQueue->QuitPosted = FALSE; MessageQueue->QuitExitCode = 0; KeQueryTickCount(&LargeTickCount); MessageQueue->LastMsgRead = LargeTickCount.u.LowPart; MessageQueue->FocusWindow = NULL; MessageQueue->NewMessagesHandle = NULL; + MessageQueue->ShowingCursor = 0; + MessageQueue->CursorObject = NULL; Status = ZwCreateEvent(&MessageQueue->NewMessagesHandle, EVENT_ALL_ACCESS, NULL, SynchronizationEvent, FALSE); @@ -1763,6 +1936,18 @@ MessageQueue->nCntsQBits[QSRosPostMessage] = 0; MessageQueue->nCntsQBits[QSRosSendMessage] = 0; MessageQueue->nCntsQBits[QSRosHotKey] = 0; + + if (MessageQueue->CursorObject) + { + PCURICON_OBJECT pCursor = MessageQueue->CursorObject; + + /* Change to another cursor if we going to dereference current one */ + if (IntGetSysCursorInfo()->CurrentCursorObject == pCursor) + UserSetCursor(NULL, TRUE); + + UserDereferenceObject(pCursor); + } + } PUSER_MESSAGE_QUEUE FASTCALL @@ -1989,5 +2174,4 @@ return ret; } - /* EOF */
13 years, 6 months
1
0
0
0
[rharabien] 52135: [WIN32K] - Check if window object still exist in proper place - Send WM_MOUSEMOVE message if mouse is over appearing window
by rharabien@svn.reactos.org
Author: rharabien Date: Tue Jun 7 20:09:04 2011 New Revision: 52135 URL:
http://svn.reactos.org/svn/reactos?rev=52135&view=rev
Log: [WIN32K] - Check if window object still exist in proper place - Send WM_MOUSEMOVE message if mouse is over appearing window Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] Tue Jun 7 20:09:04 2011 @@ -1008,17 +1008,17 @@ co_WinPosDoWinPosChanging(Window, &WinPos, &NewWindowRect, &NewClientRect); + /* Does the window still exist? */ + if (!IntIsWindow(WinPos.hwnd)) + { + EngSetLastError(ERROR_INVALID_WINDOW_HANDLE); + return FALSE; + } + /* Fix up the flags. */ if (!WinPosFixupFlags(&WinPos, Window)) { EngSetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - /* Does the window still exist? */ - if (!IntIsWindow(WinPos.hwnd)) - { - EngSetLastError(ERROR_INVALID_WINDOW_HANDLE); return FALSE; } @@ -1112,11 +1112,9 @@ } else if (WinPos.flags & SWP_SHOWWINDOW) { - if (!(Window->style & WS_VISIBLE) && - Window->spwndParent == UserGetDesktopWindow() ) - { + if (Window->spwndParent == UserGetDesktopWindow()) co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)Window->head.h); - } + Window->style |= WS_VISIBLE; } @@ -1365,6 +1363,17 @@ PWND pWnd = UserGetWindowObject(WinPos.hwnd); if (pWnd) IntNotifyWinEvent(EVENT_OBJECT_LOCATIONCHANGE, pWnd, OBJID_WINDOW, CHILDID_SELF, WEF_SETBYWNDPTI); + } + + if(IntPtInWindow(Window, gpsi->ptCursor.x, gpsi->ptCursor.y)) + { + /* Generate mouse move message */ + MSG msg; + msg.message = WM_MOUSEMOVE; + msg.wParam = IntGetSysCursorInfo()->ButtonsDown; + msg.lParam = MAKELPARAM(gpsi->ptCursor.x, gpsi->ptCursor.y); + msg.pt = gpsi->ptCursor; + co_MsqInsertMouseMessage(&msg, 0, 0, TRUE); } return TRUE;
13 years, 6 months
1
0
0
0
[tkreuzer] 52134: [NTOSKRNL] Revert r51748 by popular demand
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jun 7 19:50:01 2011 New Revision: 52134 URL:
http://svn.reactos.org/svn/reactos?rev=52134&view=rev
Log: [NTOSKRNL] Revert r51748 by popular demand Modified: trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S Modified: trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/i386/fastinter…
============================================================================== --- trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/i386/fastinterlck_asm.S [iso-8859-1] Tue Jun 7 19:50:01 2011 @@ -4,9 +4,8 @@ * FILE: ntoskrnl/ex/i386/fastinterlck_asm.S * PURPOSE: FASTCALL Interlocked Functions * PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net) - * Paolo Bonzini <bonzini [at] gnu [dot] org> - */ - + */ + /* INCLUDES ******************************************************************/ #include <asm.inc> @@ -32,55 +31,25 @@ */ PUBLIC @ExInterlockedAddLargeStatistic@8 @ExInterlockedAddLargeStatistic@8: - push ebp - push ebx - mov ebp, ecx - -Again: - /* Load comparand in eax for cmpxchg */ - mov eax, [ebp] - - /* Compute low word of the result in ebx */ - mov ebx, edx - add ebx, eax - - /* Carry needs cmpxchg8b */ - jc Slow - - /* Fast path still needs to be atomic, so use cmpxchg and retry if it fails - * Hopefully it will still get through this path :) */ - LOCK cmpxchg [ecx], ebx - jnz Again - - /* Thats it */ - pop ebx - pop ebp - ret - -Slow: - /* Save increment across cmpxchg8b */ - push edx - - /* Finish loading comparand in edx:eax */ - mov edx, [ebp+4] - - /* Result in ecx:ebx (we know there's carry) */ - lea ecx, [edx+1] - - /* Do a full exchange */ - LOCK cmpxchg8b [ebp] - - /* restore increment */ - pop edx - - /* Need to retry */ - jnz Again - - /* Thats it */ - pop ebx - pop ebp - ret - + +#ifdef CONFIG_SMP + /* Do the addition */ + lock add [ecx], edx + + /* Check for carry bit and return */ + jb .l1 + ret + +.l1: + /* Add carry */ + lock adc dword ptr [ecx+4], 0 +#else + /* Do the addition and add the carry */ + add dword ptr [ecx], edx + adc dword ptr [ecx+4], 0 +#endif + /* Return */ + ret /*ULONG *FASTCALL
13 years, 6 months
1
0
0
0
[tkreuzer] 52133: [OBJ2BIN] - Add new tool obj2bin, that converts a coff object file into a raw binary file - Move pe/coff types into a common header file pecoff.h
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jun 7 19:29:09 2011 New Revision: 52133 URL:
http://svn.reactos.org/svn/reactos?rev=52133&view=rev
Log: [OBJ2BIN] - Add new tool obj2bin, that converts a coff object file into a raw binary file - Move pe/coff types into a common header file pecoff.h Added: trunk/reactos/tools/obj2bin/ (with props) trunk/reactos/tools/obj2bin/CMakeLists.txt (with props) trunk/reactos/tools/obj2bin/obj2bin.c (with props) trunk/reactos/tools/pecoff.h (with props) Modified: trunk/reactos/tools/CMakeLists.txt trunk/reactos/tools/rsym/rsym.h Modified: trunk/reactos/tools/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/CMakeLists.txt?rev=5…
============================================================================== --- trunk/reactos/tools/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/tools/CMakeLists.txt [iso-8859-1] Tue Jun 7 19:29:09 2011 @@ -6,6 +6,7 @@ add_subdirectory(gendib) add_subdirectory(geninc) add_subdirectory(mkhive) +add_subdirectory(obj2bin) add_subdirectory(spec2def) add_subdirectory(unicode) Propchange: trunk/reactos/tools/obj2bin/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Tue Jun 7 19:29:09 2011 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/tools/obj2bin/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/tools/obj2bin/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/tools/obj2bin/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/tools/obj2bin/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/obj2bin/CMakeLists.t…
============================================================================== --- trunk/reactos/tools/obj2bin/CMakeLists.txt (added) +++ trunk/reactos/tools/obj2bin/CMakeLists.txt [iso-8859-1] Tue Jun 7 19:29:09 2011 @@ -1,0 +1,1 @@ +add_executable(obj2bin obj2bin.c) Propchange: trunk/reactos/tools/obj2bin/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/tools/obj2bin/obj2bin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/obj2bin/obj2bin.c?re…
============================================================================== --- trunk/reactos/tools/obj2bin/obj2bin.c (added) +++ trunk/reactos/tools/obj2bin/obj2bin.c [iso-8859-1] Tue Jun 7 19:29:09 2011 @@ -1,0 +1,112 @@ +#include <stdio.h> +#include <stdlib.h> +#include "../pecoff.h" + +static +void +Usage(void) +{ + printf("Converts a coff object file into a raw binary file.\n" + "Syntax: obj2bin <source file> <dest file>\n"); +} + +int main(int argc, char *argv[]) +{ + char *pszSourceFile; + char *pszDestFile; + FILE *pSourceFile, *pDestFile; + IMAGE_FILE_HEADER FileHeader; + IMAGE_SECTION_HEADER SectionHeader; + unsigned int i, nSize; + void *pData; + + if ((argc != 3) || (strcmp(argv[1], "--help") == 0)) Usage(); + + pszSourceFile = argv[1]; + pszDestFile = argv[2]; + + pSourceFile = fopen(pszSourceFile, "rb"); + if (!pSourceFile) + { + fprintf(stderr, "Couldn't open source file '%s'\n", pszSourceFile); + return -1; + } + + pDestFile = fopen(pszDestFile, "wb"); + if (!pszDestFile) + { + fprintf(stderr, "Couldn't open dest file '%s'\n", pszDestFile); + return -2; + } + + /* Load the coff header */ + nSize = fread(&FileHeader, 1, sizeof(FileHeader), pSourceFile); + if (nSize != sizeof(FileHeader)) + { + fprintf(stderr, "Failed to read source file\n"); + return -3; + } + + /* Jump to section headers (skip optional header) */ + if (fseek(pSourceFile, FileHeader.SizeOfOptionalHeader, SEEK_CUR)) + { + fprintf(stderr, "Failed to set file pointer\n"); + return -4; + } + + /* Loop all sections */ + for (i = 0; i < FileHeader.NumberOfSections; i++) + { + /* Read section header */ + nSize = fread(&SectionHeader, 1, sizeof(SectionHeader), pSourceFile); + if (nSize != sizeof(SectionHeader)) + { + fprintf(stderr, "Failed to read section %ld file\n", i); + return -5; + } + + /* Check if this is '.text' section */ + if (strcmp(SectionHeader.Name, ".text") == 0) break; + } + + if (i == FileHeader.NumberOfSections) + { + fprintf(stderr, "No .text section found\n"); + return -6; + } + + /* Move file pointer to the start of the section*/ + if (fseek(pSourceFile, SectionHeader.PointerToRawData, SEEK_SET)) + { + fprintf(stderr, "Failed to set file pointer\n"); + return -7; + } + + /* Allocate memory for the section */ + pData = malloc(SectionHeader.SizeOfRawData); + if (!pData) + { + fprintf(stderr, "Failed to allocate %ld bytes\n", SectionHeader.SizeOfRawData); + return -8; + } + + /* Read section data */ + if (!fread(pData, SectionHeader.SizeOfRawData, 1, pSourceFile)) + { + fprintf(stderr, "Failed to read section %ld file\n", i); + return -5; + } + + /* Write the section to the destination file */ + if (!fwrite(pData, SectionHeader.SizeOfRawData, 1, pDestFile)) + { + fprintf(stderr, "Failed to write data\n"); + return -9; + } + + fclose(pDestFile); + fclose(pSourceFile); + + return 0; +} + Propchange: trunk/reactos/tools/obj2bin/obj2bin.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/tools/pecoff.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/pecoff.h?rev=52133&v…
============================================================================== --- trunk/reactos/tools/pecoff.h (added) +++ trunk/reactos/tools/pecoff.h [iso-8859-1] Tue Jun 7 19:29:09 2011 @@ -1,0 +1,207 @@ +#pragma once + +#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x010b +#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x020b + +#define IMAGE_DOS_MAGIC 0x5a4d +#define IMAGE_PE_MAGIC 0x00004550 +#define IMAGE_SIZEOF_SHORT_NAME 8 + +#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 +#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 +#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 + +#define IMAGE_FILE_MACHINE_I386 0x14c +#define IMAGE_FILE_MACHINE_AMD64 0x8664 +#define IMAGE_FILE_MACHINE_IA64 0x0200 + +#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 + +#define IMAGE_SCN_TYPE_NOLOAD 0x00000002 +#define IMAGE_SCN_TYPE_NO_PAD 0x00000008 +#define IMAGE_SCN_CNT_CODE 0x00000020 +#define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 +#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 +#define IMAGE_SCN_LNK_OTHER 0x00000100 +#define IMAGE_SCN_LNK_INFO 0x00000200 +#define IMAGE_SCN_LNK_REMOVE 0x00000800 +#define IMAGE_SCN_NO_DEFER_SPEC_EXC 0x00004000 +#define IMAGE_SCN_GPREL 0x00008000 +#define IMAGE_SCN_MEM_PURGEABLE 0x00020000 +#define IMAGE_SCN_MEM_LOCKED 0x00040000 +#define IMAGE_SCN_MEM_PRELOAD 0x00080000 +#define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000 +#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 +#define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 +#define IMAGE_SCN_MEM_NOT_PAGED 0x08000000 +#define IMAGE_SCN_MEM_SHARED 0x10000000 +#define IMAGE_SCN_MEM_EXECUTE 0x20000000 +#define IMAGE_SCN_MEM_READ 0x40000000 +#define IMAGE_SCN_MEM_WRITE 0x80000000 + +#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 + +typedef unsigned char BYTE; +typedef unsigned char UCHAR; +typedef unsigned short WORD; +typedef unsigned short USHORT; +typedef unsigned long long ULONGLONG; +#if defined(__x86_64__) && !defined(_WIN64) +typedef signed int LONG; +typedef unsigned int ULONG; +typedef unsigned int DWORD; +#else +typedef signed long LONG; +typedef unsigned long ULONG; +typedef unsigned long DWORD; +#endif +#if defined(_WIN64) +typedef unsigned __int64 ULONG_PTR; +#else +#if defined(__x86_64__) && !defined(_WIN64) +typedef unsigned int ULONG_PTR; +#else +typedef unsigned long ULONG_PTR; +#endif +#endif + +#pragma pack(push,2) +typedef struct _IMAGE_DOS_HEADER { + WORD e_magic; + WORD e_cblp; + WORD e_cp; + WORD e_crlc; + WORD e_cparhdr; + WORD e_minalloc; + WORD e_maxalloc; + WORD e_ss; + WORD e_sp; + WORD e_csum; + WORD e_ip; + WORD e_cs; + WORD e_lfarlc; + WORD e_ovno; + WORD e_res[4]; + WORD e_oemid; + WORD e_oeminfo; + WORD e_res2[10]; + LONG e_lfanew; +} IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER; +#pragma pack(pop) + +#pragma pack(push,4) +typedef struct _IMAGE_FILE_HEADER { + WORD Machine; + WORD NumberOfSections; + DWORD TimeDateStamp; + DWORD PointerToSymbolTable; + DWORD NumberOfSymbols; + WORD SizeOfOptionalHeader; + WORD Characteristics; +} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; +#pragma pack(pop) + +typedef struct _IMAGE_DATA_DIRECTORY { + DWORD VirtualAddress; + DWORD Size; +} IMAGE_DATA_DIRECTORY,*PIMAGE_DATA_DIRECTORY; + +typedef struct _IMAGE_OPTIONAL_HEADER32 { + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + DWORD BaseOfData; + DWORD ImageBase; + DWORD SectionAlignment; + DWORD FileAlignment; + WORD MajorOperatingSystemVersion; + WORD MinorOperatingSystemVersion; + WORD MajorImageVersion; + WORD MinorImageVersion; + WORD MajorSubsystemVersion; + WORD MinorSubsystemVersion; + DWORD Win32VersionValue; + DWORD SizeOfImage; + DWORD SizeOfHeaders; + DWORD CheckSum; + WORD Subsystem; + WORD DllCharacteristics; + DWORD SizeOfStackReserve; + DWORD SizeOfStackCommit; + DWORD SizeOfHeapReserve; + DWORD SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; +} IMAGE_OPTIONAL_HEADER32,*PIMAGE_OPTIONAL_HEADER32; + +typedef struct _IMAGE_OPTIONAL_HEADER64 { + WORD Magic; + BYTE MajorLinkerVersion; + BYTE MinorLinkerVersion; + DWORD SizeOfCode; + DWORD SizeOfInitializedData; + DWORD SizeOfUninitializedData; + DWORD AddressOfEntryPoint; + DWORD BaseOfCode; + ULONGLONG ImageBase; + DWORD SectionAlignment; + DWORD FileAlignment; + WORD MajorOperatingSystemVersion; + WORD MinorOperatingSystemVersion; + WORD MajorImageVersion; + WORD MinorImageVersion; + WORD MajorSubsystemVersion; + WORD MinorSubsystemVersion; + DWORD Win32VersionValue; + DWORD SizeOfImage; + DWORD SizeOfHeaders; + DWORD CheckSum; + WORD Subsystem; + WORD DllCharacteristics; + ULONGLONG SizeOfStackReserve; + ULONGLONG SizeOfStackCommit; + ULONGLONG SizeOfHeapReserve; + ULONGLONG SizeOfHeapCommit; + DWORD LoaderFlags; + DWORD NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; +} IMAGE_OPTIONAL_HEADER64,*PIMAGE_OPTIONAL_HEADER64; + +#ifdef _TARGET_PE64 +typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER; +typedef PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER; +#else +typedef IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER; +typedef PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER; +#endif + +typedef struct _IMAGE_SECTION_HEADER { + BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; + union { + DWORD PhysicalAddress; + DWORD VirtualSize; + } Misc; + DWORD VirtualAddress; + DWORD SizeOfRawData; + DWORD PointerToRawData; + DWORD PointerToRelocations; + DWORD PointerToLinenumbers; + WORD NumberOfRelocations; + WORD NumberOfLinenumbers; + DWORD Characteristics; +} IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER; + +#pragma pack(push,4) +typedef struct _IMAGE_BASE_RELOCATION { + DWORD VirtualAddress; + DWORD SizeOfBlock; + WORD TypeOffset[1]; +} IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION; +#pragma pack(pop) + Propchange: trunk/reactos/tools/pecoff.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/tools/rsym/rsym.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rsym/rsym.h?rev=5213…
============================================================================== --- trunk/reactos/tools/rsym/rsym.h [iso-8859-1] (original) +++ trunk/reactos/tools/rsym/rsym.h [iso-8859-1] Tue Jun 7 19:29:09 2011 @@ -1,209 +1,7 @@ /* rsym.h */ #pragma once - -#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x010b -#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x020b - -#define IMAGE_DOS_MAGIC 0x5a4d -#define IMAGE_PE_MAGIC 0x00004550 -#define IMAGE_SIZEOF_SHORT_NAME 8 - -#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 -#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 -#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 - -#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 - -#define IMAGE_SCN_TYPE_NOLOAD 0x00000002 -#define IMAGE_SCN_TYPE_NO_PAD 0x00000008 -#define IMAGE_SCN_CNT_CODE 0x00000020 -#define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 -#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 -#define IMAGE_SCN_LNK_OTHER 0x00000100 -#define IMAGE_SCN_LNK_INFO 0x00000200 -#define IMAGE_SCN_LNK_REMOVE 0x00000800 -#define IMAGE_SCN_NO_DEFER_SPEC_EXC 0x00004000 -#define IMAGE_SCN_GPREL 0x00008000 -#define IMAGE_SCN_MEM_PURGEABLE 0x00020000 -#define IMAGE_SCN_MEM_LOCKED 0x00040000 -#define IMAGE_SCN_MEM_PRELOAD 0x00080000 -#define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000 -#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 -#define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 -#define IMAGE_SCN_MEM_NOT_PAGED 0x08000000 -#define IMAGE_SCN_MEM_SHARED 0x10000000 -#define IMAGE_SCN_MEM_EXECUTE 0x20000000 -#define IMAGE_SCN_MEM_READ 0x40000000 -#define IMAGE_SCN_MEM_WRITE 0x80000000 - -#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 - -typedef unsigned char BYTE; -typedef unsigned char UCHAR; -typedef unsigned short WORD; -typedef unsigned short USHORT; -typedef unsigned long long ULONGLONG; -#if defined(__x86_64__) && !defined(_WIN64) -typedef signed int LONG; -typedef unsigned int ULONG; -typedef unsigned int DWORD; -#else -typedef signed long LONG; -typedef unsigned long ULONG; -typedef unsigned long DWORD; -#endif -#if defined(_WIN64) -typedef unsigned __int64 ULONG_PTR; -#else -#if defined(__x86_64__) && !defined(_WIN64) -typedef unsigned int ULONG_PTR; -#else -typedef unsigned long ULONG_PTR; -#endif -#endif - -#pragma pack(push,2) - -typedef struct _IMAGE_DOS_HEADER { - WORD e_magic; - WORD e_cblp; - WORD e_cp; - WORD e_crlc; - WORD e_cparhdr; - WORD e_minalloc; - WORD e_maxalloc; - WORD e_ss; - WORD e_sp; - WORD e_csum; - WORD e_ip; - WORD e_cs; - WORD e_lfarlc; - WORD e_ovno; - WORD e_res[4]; - WORD e_oemid; - WORD e_oeminfo; - WORD e_res2[10]; - LONG e_lfanew; -} IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER; -#pragma pack(pop) - -#pragma pack(push,4) -typedef struct _IMAGE_FILE_HEADER { - WORD Machine; - WORD NumberOfSections; - DWORD TimeDateStamp; - DWORD PointerToSymbolTable; - DWORD NumberOfSymbols; - WORD SizeOfOptionalHeader; - WORD Characteristics; -} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; -#pragma pack(pop) - -typedef struct _IMAGE_DATA_DIRECTORY { - DWORD VirtualAddress; - DWORD Size; -} IMAGE_DATA_DIRECTORY,*PIMAGE_DATA_DIRECTORY; - -typedef struct _IMAGE_OPTIONAL_HEADER32 { - WORD Magic; - BYTE MajorLinkerVersion; - BYTE MinorLinkerVersion; - DWORD SizeOfCode; - DWORD SizeOfInitializedData; - DWORD SizeOfUninitializedData; - DWORD AddressOfEntryPoint; - DWORD BaseOfCode; - DWORD BaseOfData; - DWORD ImageBase; - DWORD SectionAlignment; - DWORD FileAlignment; - WORD MajorOperatingSystemVersion; - WORD MinorOperatingSystemVersion; - WORD MajorImageVersion; - WORD MinorImageVersion; - WORD MajorSubsystemVersion; - WORD MinorSubsystemVersion; - DWORD Win32VersionValue; - DWORD SizeOfImage; - DWORD SizeOfHeaders; - DWORD CheckSum; - WORD Subsystem; - WORD DllCharacteristics; - DWORD SizeOfStackReserve; - DWORD SizeOfStackCommit; - DWORD SizeOfHeapReserve; - DWORD SizeOfHeapCommit; - DWORD LoaderFlags; - DWORD NumberOfRvaAndSizes; - IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; -} IMAGE_OPTIONAL_HEADER32,*PIMAGE_OPTIONAL_HEADER32; - -typedef struct _IMAGE_OPTIONAL_HEADER64 { - WORD Magic; - BYTE MajorLinkerVersion; - BYTE MinorLinkerVersion; - DWORD SizeOfCode; - DWORD SizeOfInitializedData; - DWORD SizeOfUninitializedData; - DWORD AddressOfEntryPoint; - DWORD BaseOfCode; - ULONGLONG ImageBase; - DWORD SectionAlignment; - DWORD FileAlignment; - WORD MajorOperatingSystemVersion; - WORD MinorOperatingSystemVersion; - WORD MajorImageVersion; - WORD MinorImageVersion; - WORD MajorSubsystemVersion; - WORD MinorSubsystemVersion; - DWORD Win32VersionValue; - DWORD SizeOfImage; - DWORD SizeOfHeaders; - DWORD CheckSum; - WORD Subsystem; - WORD DllCharacteristics; - ULONGLONG SizeOfStackReserve; - ULONGLONG SizeOfStackCommit; - ULONGLONG SizeOfHeapReserve; - ULONGLONG SizeOfHeapCommit; - DWORD LoaderFlags; - DWORD NumberOfRvaAndSizes; - IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; -} IMAGE_OPTIONAL_HEADER64,*PIMAGE_OPTIONAL_HEADER64; - - -#ifdef _TARGET_PE64 -typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER; -typedef PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER; -#else -typedef IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER; -typedef PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER; -#endif - -typedef struct _IMAGE_SECTION_HEADER { - BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; - union { - DWORD PhysicalAddress; - DWORD VirtualSize; - } Misc; - DWORD VirtualAddress; - DWORD SizeOfRawData; - DWORD PointerToRawData; - DWORD PointerToRelocations; - DWORD PointerToLinenumbers; - WORD NumberOfRelocations; - WORD NumberOfLinenumbers; - DWORD Characteristics; -} IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER; - -#pragma pack(push,4) -typedef struct _IMAGE_BASE_RELOCATION { - DWORD VirtualAddress; - DWORD SizeOfBlock; - WORD TypeOffset[1]; -} IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION; -#pragma pack(pop) +#include "../pecoff.h" typedef struct { USHORT f_magic; /* magic number */
13 years, 6 months
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
46
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
Results per page:
10
25
50
100
200