- Some minor Nt stub fixes

- Fix compilation with GCC4

svn path=/trunk/; revision=24578
This commit is contained in:
Thomas Bluemel 2006-10-20 13:19:13 +00:00
parent d9b18cdbb2
commit ccd9ed0a4e
5 changed files with 44 additions and 21 deletions

View file

@ -471,6 +471,7 @@ typedef struct _COMPRESSED_DATA_INFO COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INF
//
// Routines and callbacks for the RTL AVL/Generic Table package
//
#if defined(NTOS_MODE_USER) || (!defined(NTOS_MODE_USER) && !defined(_NTIFS_))
typedef NTSTATUS
(NTAPI *PRTL_AVL_MATCH_FUNCTION)(
struct _RTL_AVL_TABLE *Table,
@ -515,6 +516,7 @@ typedef VOID
struct _RTL_AVL_TABLE *Table,
PVOID Buffer
);
#endif
//
// RTL Query Registry callback

View file

@ -793,6 +793,7 @@ NtDebugContinue(IN HANDLE DebugHandle,
/* Probe the handle */
ProbeForRead(AppClientId, sizeof(CLIENT_ID), sizeof(ULONG));
ClientId = *AppClientId;
AppClientId = &ClientId;
}
_SEH_HANDLE
{
@ -838,7 +839,7 @@ NtDebugContinue(IN HANDLE DebugHandle,
/* Compare process ID */
if (DebugEvent->ClientId.UniqueProcess ==
ClientId.UniqueProcess)
AppClientId->UniqueProcess)
{
/* Check if we already found a match */
if (NeedsWake)
@ -853,7 +854,7 @@ NtDebugContinue(IN HANDLE DebugHandle,
/* Compare thread ID and flag */
if ((DebugEvent->ClientId.UniqueThread ==
ClientId.UniqueThread) && (DebugEvent->Flags & 1))
AppClientId->UniqueThread) && (DebugEvent->Flags & 1))
{
/* Remove the event from the list */
RemoveEntryList(NextEntry);
@ -1034,7 +1035,19 @@ NtSetInformationDebugObject(IN HANDLE DebugHandle,
PreviousMode);
/* Return required length to user-mode */
if (ReturnLength) *ReturnLength = sizeof(*DebugInfo);
if (ReturnLength)
{
_SEH_TRY
{
ProbeForWriteUlong(ReturnLength);
*ReturnLength = sizeof(*DebugInfo);
}
_SEH_EXCEPT(_SEH_ExSystemExceptionFilter)
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
}
if (!NT_SUCCESS(Status)) return Status;
/* Open the Object */
@ -1096,13 +1109,18 @@ NtWaitForDebugEvent(IN HANDLE DebugHandle,
RtlZeroMemory(&WaitStateChange, sizeof(WaitStateChange));
/* Check if we came with a timeout from user mode */
if ((Timeout) && (PreviousMode != KernelMode))
if (PreviousMode != KernelMode)
{
_SEH_TRY
{
/* Make a copy on the stack */
SafeTimeOut = ProbeForReadLargeInteger(Timeout);
Timeout = &SafeTimeOut;
if (Timeout)
{
/* Make a copy on the stack */
SafeTimeOut = ProbeForReadLargeInteger(Timeout);
Timeout = &SafeTimeOut;
}
ProbeForWrite(StateChange, sizeof(*StateChange), sizeof(ULONG));
}
_SEH_HANDLE
{
@ -1116,12 +1134,6 @@ NtWaitForDebugEvent(IN HANDLE DebugHandle,
KeQuerySystemTime(&StartTime);
}
/* Check if the call is from user mode */
if (PreviousMode == UserMode)
{
/* FIXME: Probe the state change structure */
}
/* Get the debug object */
Status = ObReferenceObjectByHandle(DebugHandle,
DEBUG_OBJECT_WAIT_STATE_CHANGE,
@ -1268,9 +1280,18 @@ NtWaitForDebugEvent(IN HANDLE DebugHandle,
ObDereferenceObject(DebugObject);
/* Return our wait state change structure */
RtlMoveMemory(StateChange,
&WaitStateChange,
sizeof(DBGUI_WAIT_STATE_CHANGE));
_SEH_TRY
{
RtlCopyMemory(StateChange,
&WaitStateChange,
sizeof(DBGUI_WAIT_STATE_CHANGE));
}
_SEH_EXCEPT(_SEH_ExSystemExceptionFilter)
{
Status = _SEH_GetExceptionCode();
}
_SEH_END;
return Status;
}

View file

@ -147,7 +147,7 @@ ObpDecrementHandleCount(IN PVOID ObjectBody,
ObpDeleteNameCheck(ObjectBody);
/* Decrease the total number of handles for this type */
InterlockedDecrement(&ObjectType->TotalNumberOfHandles);
InterlockedDecrement((PLONG)&ObjectType->TotalNumberOfHandles);
OBTRACE(OB_HANDLE_DEBUG,
"%s - Decremented count for: %p. HC LC %lx %lx\n",
__FUNCTION__,
@ -388,7 +388,7 @@ ObpIncrementHandleCount(IN PVOID Object,
}
/* Increase total number of handles */
InterlockedIncrement(&ObjectType->TotalNumberOfHandles);
InterlockedIncrement((PLONG)&ObjectType->TotalNumberOfHandles);
OBTRACE(OB_HANDLE_DEBUG,
"%s - Incremented count for: %p. Reason: %lx HC LC %lx %lx\n",
__FUNCTION__,
@ -494,7 +494,7 @@ ObpIncrementUnnamedHandleCount(IN PVOID Object,
}
/* Increase total number of handles */
InterlockedIncrement(&ObjectType->TotalNumberOfHandles);
InterlockedIncrement((PLONG)&ObjectType->TotalNumberOfHandles);
OBTRACE(OB_HANDLE_DEBUG,
"%s - Incremented count for: %p. UNNAMED HC LC %lx %lx\n",
__FUNCTION__,

View file

@ -71,7 +71,7 @@ ObpDeallocateObject(IN PVOID Object)
}
/* Decrease the total */
InterlockedDecrement(&ObjectType->TotalNumberOfObjects);
InterlockedDecrement((PLONG)&ObjectType->TotalNumberOfObjects);
/* Check if we have create info */
if (Header->Flags & OB_FLAG_CREATE_INFO)

View file

@ -724,7 +724,7 @@ IntCreateDIBitmap(PDC Dc, const BITMAPINFOHEADER *header,
{
if (data->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
{
RGBQUAD *rgb = data->bmiColors;
const RGBQUAD *rgb = data->bmiColors;
DWORD col = RGB( rgb->rgbRed, rgb->rgbGreen, rgb->rgbBlue );
// Check if the first color of the colormap is black