Author: greatlrd
Date: Fri Jun 6 19:27:13 2008
New Revision: 33874
URL: http://svn.reactos.org/svn/reactos?rev=33874&view=rev
Log:
Change BitBlt so it act simluare to windows, but this changes will break trunk graphic,
Waring Waring Waring Waring do not merge down this change to trunk until NtGdiPatBlt are bugfixed
it seam it contain allot of graphic glitch and it seam it does not call on the hw gdi acclartions of PatBlt
and some other issue.
Modified:
branches/win32k-gdi-dx/dll/win32/gdi32/include/gdi32p.h
branches/win32k-gdi-dx/dll/win32/gdi32/objects/bitmap.c
Modified: branches/win32k-gdi-dx/dll/win32/gdi32/include/gdi32p.h
URL: http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/gdi32/i…
==============================================================================
--- branches/win32k-gdi-dx/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] (original)
+++ branches/win32k-gdi-dx/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] Fri Jun 6 19:27:13 2008
@@ -24,6 +24,10 @@
INT iFunction,
HANDLE hPageQuery
);
+
+/* MACRO ********************************************************************/
+#define ROP_USES_SOURCE(Rop) (Rop & 0x00330000)
+
/* DEFINES *******************************************************************/
Modified: branches/win32k-gdi-dx/dll/win32/gdi32/objects/bitmap.c
URL: http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/gdi32/o…
==============================================================================
--- branches/win32k-gdi-dx/dll/win32/gdi32/objects/bitmap.c [iso-8859-1] (original)
+++ branches/win32k-gdi-dx/dll/win32/gdi32/objects/bitmap.c [iso-8859-1] Fri Jun 6 19:27:13 2008
@@ -139,6 +139,12 @@
int nYSrc, /* y-coordinate of source upper-left corner */
DWORD dwRop) /* raster operation code */
{
+ /* use patBlt for no source blt Like windows does */
+ if (!ROP_USES_SOURCE(dwRop))
+ {
+ return PatBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, dwRop);
+ }
+
return NtGdiBitBlt(hdcDest,
nXOriginDest,
nYOriginDest,
@@ -447,8 +453,9 @@
ColorUse,
lpbmi->bmiHeader.biSizeImage,
lpbmi->bmiHeader.biSize,
- FALSE,
+ TRUE,
NULL);
}
+
Author: fireball
Date: Fri Jun 6 16:43:37 2008
New Revision: 33870
URL: http://svn.reactos.org/svn/reactos?rev=33870&view=rev
Log:
- Fix a major bug while closing a process that was debugging another process, which would cause a bugcheck because it tried to kill itself while it was being killed -- instead, it should try killing the debuggee! fixes the bug that arty and I fought about when he said "process killing seems broken" and tried to add delayed-object-closing. Patch by Alex Ionescu.
- Remove a leftover from kernel32 which assumed that if "BeingDebugged" was TRUE, the library was being tested on an XP machine.
Modified:
trunk/reactos/dll/win32/kernel32/misc/dllmain.c
trunk/reactos/ntoskrnl/dbgk/dbgkobj.c
Modified: trunk/reactos/dll/win32/kernel32/misc/dllmain.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/dl…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/dllmain.c [iso-8859-1] Fri Jun 6 16:43:37 2008
@@ -257,42 +257,6 @@
{
case DLL_PROCESS_ATTACH:
-#ifdef _M_IX86
- /* OK, yes, this is really retarded but it works for now */
- InWindows = NtCurrentPeb()->BeingDebugged;
-
- /*
- * CreateProcess will run in the real kernel32 and it will write
- * its own BaseProcessStartThunk EIP in the CONTEXT that ZwContinue
- * will get. We'll be first called by Ldr while initializing, and we'll
- * be wrapped in 3 layers of SEH, followed by two frames, finally
- * followed by our CONTEXT on the stack. We'll modify the EIP in it
- * to match the correct one (our own) and then everything works.
- * Tested on XP and 2K3, probably doesn't work in 2K.
- */
- if (InWindows)
- {
- /*
- * Due to yet another bug in how Windows handles .local, LDR will
- * actually end up loading us twice. The second time will be the
- * "official" load, at a totally different address. It will be,
- * it will be at -that- address that all the APIs will be called.
- * However, that address is dynamic while this one will be static,
- * so we'll do initilization with this one. Plus, at this one,
- * we know exactly that we're within 3 SEH layers.
- */
- if (hDll == (HANDLE)0x7c800000)
- {
- PULONG Eip;
- __debugbreak();
- Eip = (PULONG)*(PULONG)*(PULONG)NtCurrentTeb()->Tib.ExceptionList +
- 0x9 +
- FIELD_OFFSET(CONTEXT, Eip) / sizeof(ULONG);
- *Eip = (ULONG)BaseProcessStartThunk;
- }
- }
-#endif
-
/* Don't bother us for each thread */
LdrDisableThreadCalloutsForDll((PVOID)hDll);
Modified: trunk/reactos/ntoskrnl/dbgk/dbgkobj.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/dbgk/dbgkobj.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/dbgk/dbgkobj.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/dbgk/dbgkobj.c [iso-8859-1] Fri Jun 6 16:43:37 2008
@@ -115,7 +115,7 @@
KeInitializeEvent(&DebugEvent->ContinueEvent, SynchronizationEvent, FALSE);
DebugEvent->Process = Process;
DebugEvent->Thread = Thread;
- RtlCopyMemory(&DebugEvent->ApiMsg, Message, sizeof(DBGKM_MSG));
+ DebugEvent->ApiMsg = *Message;
DebugEvent->ClientId = Thread->Cid;
/* Check if we have a port object */
@@ -176,7 +176,7 @@
NULL);
/* Copy API Message back */
- RtlCopyMemory(Message, &DebugEvent->ApiMsg, sizeof(DBGKM_MSG));
+ *Message = DebugEvent->ApiMsg;
/* Set return status */
Status = DebugEvent->Status;
@@ -1079,8 +1079,6 @@
DBGKTRACE(DBGK_OBJECT_DEBUG, "OwnerProcess: %p DebugObject: %p\n",
OwnerProcess, DebugObject);
- DPRINT("APC DISABLE: %d\n", ((PETHREAD)KeGetCurrentThread())->Tcb.CombinedApcDisable);
-
/* If this isn't the last handle, do nothing */
if (SystemHandleCount > 1) return;
@@ -1124,13 +1122,13 @@
if (DebugPortCleared)
{
/* Mark this in the PEB */
- DbgkpMarkProcessPeb(OwnerProcess);
+ DbgkpMarkProcessPeb(Process);
/* Check if we terminate on exit */
if (DebugObject->KillProcessOnExit)
{
/* Terminate the process */
- PsTerminateProcess(OwnerProcess, STATUS_DEBUGGER_INACTIVE);
+ PsTerminateProcess(Process, STATUS_DEBUGGER_INACTIVE);
}
/* Dereference the debug object */
@@ -1192,6 +1190,7 @@
if (NT_SUCCESS(Status))
{
/* Acquire the global lock */
+ThreadScan:
GlobalHeld = TRUE;
ExAcquireFastMutex(&DbgkpProcessDebugPortMutex);
@@ -1203,7 +1202,6 @@
}
else
{
-ThreadScan:
/* Otherwise, set the port and reference the thread */
Process->DebugPort = DebugObject;
ObReferenceObject(LastThread);
@@ -1235,14 +1233,7 @@
{
/* Dereference the first thread and re-acquire the lock */
ObDereferenceObject(FirstThread);
- GlobalHeld = TRUE;
- ExAcquireFastMutex(&DbgkpProcessDebugPortMutex);
-
- /* Check if we should loop again */
- if (!Process->DebugPort) goto ThreadScan;
-
- /* Otherwise, we already have a port */
- Status = STATUS_PORT_ALREADY_SET;
+ goto ThreadScan;
}
}
}
@@ -1265,8 +1256,7 @@
{
/* Set the process flags */
InterlockedOr((PLONG)&Process->Flags,
- PSF_NO_DEBUG_INHERIT_BIT |
- PSF_CREATE_REPORTED_BIT);
+ PSF_NO_DEBUG_INHERIT_BIT | PSF_CREATE_REPORTED_BIT);
/* Reference the debug object */
ObDereferenceObject(DebugObject);
@@ -2012,7 +2002,7 @@
StartTime = NewTime;
/* Check if we've timed out */
- if (SafeTimeOut.QuadPart > 0)
+ if (SafeTimeOut.QuadPart >= 0)
{
/* We have, break out of the loop */
Status = STATUS_TIMEOUT;
@@ -2037,9 +2027,7 @@
_SEH_TRY
{
/* Return our wait state change structure */
- RtlCopyMemory(StateChange,
- &WaitStateChange,
- sizeof(DBGUI_WAIT_STATE_CHANGE));
+ *StateChange = WaitStateChange;
}
_SEH_EXCEPT(_SEH_ExSystemExceptionFilter)
{
Author: fireball
Date: Fri Jun 6 16:33:43 2008
New Revision: 33868
URL: http://svn.reactos.org/svn/reactos?rev=33868&view=rev
Log:
- Update RtlIsTextUnicode (fixes some ntdll rtlstr winetests).
Modified:
trunk/reactos/include/ndk/rtlfuncs.h
trunk/reactos/lib/rtl/unicode.c
Modified: trunk/reactos/include/ndk/rtlfuncs.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Fri Jun 6 16:33:43 2008
@@ -1690,12 +1690,12 @@
);
NTSYSAPI
-ULONG
+BOOLEAN
NTAPI
RtlIsTextUnicode(
- PVOID Buffer,
- ULONG Length,
- ULONG *Flags
+ LPCVOID Buffer,
+ INT Length,
+ INT *Flags
);
NTSYSAPI
Modified: trunk/reactos/lib/rtl/unicode.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/unicode.c?rev=3386…
==============================================================================
--- trunk/reactos/lib/rtl/unicode.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/unicode.c [iso-8859-1] Fri Jun 6 16:33:43 2008
@@ -1055,57 +1055,84 @@
* RETURNS
* The length of the string if all tests were passed, 0 otherwise.
*/
-ULONG NTAPI
-RtlIsTextUnicode (PVOID Buffer,
- ULONG Length,
- ULONG *Flags)
-{
- PWSTR s = Buffer;
- ULONG in_flags = (ULONG)-1;
- ULONG out_flags = 0;
-
- if (Length == 0)
- goto done;
-
- if (Flags != 0)
- in_flags = *Flags;
-
- /*
- * Apply various tests to the text string. According to the
- * docs, each test "passed" sets the corresponding flag in
- * the output flags. But some of the tests are mutually
- * exclusive, so I don't see how you could pass all tests ...
- */
-
- /* Check for an odd length ... pass if even. */
- if (!(Length & 1))
- out_flags |= IS_TEXT_UNICODE_ODD_LENGTH;
-
- /* Check for the BOM (byte order mark). */
- if (*s == 0xFEFF)
- out_flags |= IS_TEXT_UNICODE_SIGNATURE;
-
-#if 0
- /* Check for the reverse BOM (byte order mark). */
- if (*s == 0xFFFE)
- out_flags |= IS_TEXT_UNICODE_REVERSE_SIGNATURE;
-#endif
-
- /* FIXME: Add more tests */
-
- /*
- * Check whether the string passed all of the tests.
- */
- in_flags &= ITU_IMPLEMENTED_TESTS;
- if ((out_flags & in_flags) != in_flags)
- Length = 0;
-
-done:
- if (Flags != 0)
- *Flags = out_flags;
-
- return Length;
-}
+BOOLEAN
+NTAPI
+RtlIsTextUnicode( LPCVOID buf, INT len, INT *pf )
+{
+ const WCHAR *s = buf;
+ int i;
+ unsigned int flags = ~0U, out_flags = 0;
+
+ if (len < sizeof(WCHAR))
+ {
+ /* FIXME: MSDN documents IS_TEXT_UNICODE_BUFFER_TOO_SMALL but there is no such thing... */
+ if (pf) *pf = 0;
+ return FALSE;
+ }
+ if (pf)
+ flags = *pf;
+ /*
+ * Apply various tests to the text string. According to the
+ * docs, each test "passed" sets the corresponding flag in
+ * the output flags. But some of the tests are mutually
+ * exclusive, so I don't see how you could pass all tests ...
+ */
+
+ /* Check for an odd length ... pass if even. */
+ if (len & 1) out_flags |= IS_TEXT_UNICODE_ODD_LENGTH;
+
+ if (((char *)buf)[len - 1] == 0)
+ len--; /* Windows seems to do something like that to avoid e.g. false IS_TEXT_UNICODE_NULL_BYTES */
+
+ len /= sizeof(WCHAR);
+ /* Windows only checks the first 256 characters */
+ if (len > 256) len = 256;
+
+ /* Check for the special byte order unicode marks. */
+ if (*s == 0xFEFF) out_flags |= IS_TEXT_UNICODE_SIGNATURE;
+ if (*s == 0xFFFE) out_flags |= IS_TEXT_UNICODE_REVERSE_SIGNATURE;
+
+ /* apply some statistical analysis */
+ if (flags & IS_TEXT_UNICODE_STATISTICS)
+ {
+ int stats = 0;
+ /* FIXME: checks only for ASCII characters in the unicode stream */
+ for (i = 0; i < len; i++)
+ {
+ if (s[i] <= 255) stats++;
+ }
+ if (stats > len / 2)
+ out_flags |= IS_TEXT_UNICODE_STATISTICS;
+ }
+
+ /* Check for unicode NULL chars */
+ if (flags & IS_TEXT_UNICODE_NULL_BYTES)
+ {
+ for (i = 0; i < len; i++)
+ {
+ if (!(s[i] & 0xff) || !(s[i] >> 8))
+ {
+ out_flags |= IS_TEXT_UNICODE_NULL_BYTES;
+ break;
+ }
+ }
+ }
+
+ if (pf)
+ {
+ out_flags &= *pf;
+ *pf = out_flags;
+ }
+ /* check for flags that indicate it's definitely not valid Unicode */
+ if (out_flags & (IS_TEXT_UNICODE_REVERSE_MASK | IS_TEXT_UNICODE_NOT_UNICODE_MASK)) return FALSE;
+ /* now check for invalid ASCII, and assume Unicode if so */
+ if (out_flags & IS_TEXT_UNICODE_NOT_ASCII_MASK) return TRUE;
+ /* now check for Unicode flags */
+ if (out_flags & IS_TEXT_UNICODE_UNICODE_MASK) return TRUE;
+ /* no flags set */
+ return FALSE;
+}
+
/*
* @implemented