- Don't use -1 for USHORT LDR_DATA_TABLE_ENTRY::LoadCount. When comparing ((USHORT)-1) == 0xFFFF vs (int)-1 it ends in comparison 0xFFFF vs 0xFFFFFFFF with is wrong. Fixes shutdown from shell
See issue #6345 for more details.
svn path=/trunk/; revision=52601
- Fix broken TDI address functions which were causing subtle memory corruptions, wasted memory, and incorrect or uninitialized values of the address length field
- Remove some buggy code that wasn't used anywhere
- General refactoring to reduce code duplication
- Handle an invalid address type properly
svn path=/trunk/; revision=52600
- Probe and lock pages with the KernelMode access mode instead of Irp->RequestorMode (UserMode) since we're dealing with memory that we allocated in kernel-mode
- Fixes getpeername() and HTTPS browsing in Firefox
svn path=/trunk/; revision=52597
[NTDLL]: Use original symbolic function names instead of modified ones.
[NTDLL]: Fixup some incorrect flag and typedef definitions with correct ones.
[NTDLL]: Tag functions which seem broken/lacking in functionality/very different from the rest of the code the LDR rewrite was based on.
svn path=/trunk/; revision=52595
- Fix CMake build
- Don't override failure status in LdrGetDllHandleEx
- Minor improvements
Fixes loading of mshtml.tlb in 2nd stage. Patch by Thomas Faber
svn path=/trunk/; revision=52591
- Don't build normaliz.dll - it's Win Vista library. It didn't even work because exports was redirected to commented out kernel32 exports. GCC ignored it but MSVC returns error in such case.
svn path=/trunk/; revision=52587
Update TRAP_ENTRY macro to generate debugging information. Now WinDbg knows how to deal with the trap functions and also shows the user mode back traces.
svn path=/trunk/; revision=52586
[NTDLL]: Fix LdrpInitializeProcess to use new loader relocation API instead of LdrRelocateImage. Warn if an EXE gets relocated since this was never supported in ReactOS.
[NTDLL]: Move APIs into ldrapi.c and delete 3 leftover cruft files.
This is the extent of my review for the moment. There are still many problems with the loader. It should've been tested/put in a branch. I found these 25 bugs in less than a day. Other problems remaining are missing SEH around loader lock, not too sure if the cookie generation is correct, cookies are ULONG_PTR not ULONGs, and haven't checked the PE loading code yet (only reviewed ldrapi.c).
svn path=/trunk/; revision=52585
[NTDLL]: LdrVerifyImageMatchesCheckSum does not actually do the check if the FileHandle is ORed with 1 (this is an optimization for KnownDLLs). Also, use EndOfFile.LowPart for the checksum, not ViewSize.
[NTDLL]: LdrpGetProcedureAddress: fix overflows, incorrect constants, incorrect memcopy call, and only run init routines if the thunk was actually snapped.
svn path=/trunk/; revision=52583
In MmDbgCopyMemory do physical memory copy, if the virtual target address is valid, but not writable. Fixes Step-Over on user mode addresses with WinDbg (can write break points now)
svn path=/trunk/; revision=52582
- Comment out the actctx redirection check because it's placed wrongly. This should fix cases when a DLL is being loaded twice or more times for the same process. Spotted by Rafal Harabien.
svn path=/trunk/; revision=52577
- Use \\KnownDlls\\KnownDllPath instead of \\KnownDlls\\KnownDlls to check known dlls patch (spotted by Thomas Faber)
- Assume known dlls are in system32 if \\KnownDlls exists but KnownDllPath not
svn path=/trunk/; revision=52574
- Signal the event immediately if the select triggers have already been satisfied
- This fixes hangs with applications that wait on the select event before performing any socket operations
svn path=/trunk/; revision=52562
- Let WSPSend handle WSPSendTo on a non-datagram socket (mswsock_new does this)
- Fixes sendto on connection-oriented sockets
svn path=/trunk/; revision=52560
- Return the amount of data sent in XXXSendDatagram() functions
- Fixes send() and sendto() return values for datagram sockets (bug exposed by the AFD send user-mode IRP rewrite)
svn path=/trunk/; revision=52559
- Move read-only data into data section (allows to boot with GRUB again).
- Discard .drectve sections.
- Silence "set but not used" warnings.
svn path=/trunk/; revision=52557
- Let WSPRecv handle WSPRecvFrom on a non-datagram socket (mswsock_new does this)
- Fixes recvfrom on connection-oriented sockets
svn path=/trunk/; revision=52553
- Rewrite user-mode send IRP handling so send errors get returned to the user properly
- Fixes OskitTCP: ESHUTDOWN/EPIPE debug log spam when a chargen telnet session is terminated by the remote side
svn path=/trunk/; revision=52552
Fix 2nd stage pool corruption.
CCBs are organized in a linked list in the corresponding Fcb, which is protected by Fcb->CcbListLock. They are also linked together server <-> client. This way they can be referenced without holding the lock. This lead to a race condition where a CCB's link was modified after the CCB was deleted. Fix this by using a reference counter and adding appropriate functions. Also make use of pool tags.
svn path=/trunk/; revision=52547
- Remove formatting and partitioning hacks which are unnecessary after fixing the invalid signature bug in the FAT formatting code
svn path=/trunk/; revision=52540