mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
- Some minor Nt stub fixes
- Fix compilation with GCC4 svn path=/trunk/; revision=24578
This commit is contained in:
parent
d9b18cdbb2
commit
ccd9ed0a4e
5 changed files with 44 additions and 21 deletions
|
@ -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
|
// Routines and callbacks for the RTL AVL/Generic Table package
|
||||||
//
|
//
|
||||||
|
#if defined(NTOS_MODE_USER) || (!defined(NTOS_MODE_USER) && !defined(_NTIFS_))
|
||||||
typedef NTSTATUS
|
typedef NTSTATUS
|
||||||
(NTAPI *PRTL_AVL_MATCH_FUNCTION)(
|
(NTAPI *PRTL_AVL_MATCH_FUNCTION)(
|
||||||
struct _RTL_AVL_TABLE *Table,
|
struct _RTL_AVL_TABLE *Table,
|
||||||
|
@ -515,6 +516,7 @@ typedef VOID
|
||||||
struct _RTL_AVL_TABLE *Table,
|
struct _RTL_AVL_TABLE *Table,
|
||||||
PVOID Buffer
|
PVOID Buffer
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// RTL Query Registry callback
|
// RTL Query Registry callback
|
||||||
|
|
|
@ -793,6 +793,7 @@ NtDebugContinue(IN HANDLE DebugHandle,
|
||||||
/* Probe the handle */
|
/* Probe the handle */
|
||||||
ProbeForRead(AppClientId, sizeof(CLIENT_ID), sizeof(ULONG));
|
ProbeForRead(AppClientId, sizeof(CLIENT_ID), sizeof(ULONG));
|
||||||
ClientId = *AppClientId;
|
ClientId = *AppClientId;
|
||||||
|
AppClientId = &ClientId;
|
||||||
}
|
}
|
||||||
_SEH_HANDLE
|
_SEH_HANDLE
|
||||||
{
|
{
|
||||||
|
@ -838,7 +839,7 @@ NtDebugContinue(IN HANDLE DebugHandle,
|
||||||
|
|
||||||
/* Compare process ID */
|
/* Compare process ID */
|
||||||
if (DebugEvent->ClientId.UniqueProcess ==
|
if (DebugEvent->ClientId.UniqueProcess ==
|
||||||
ClientId.UniqueProcess)
|
AppClientId->UniqueProcess)
|
||||||
{
|
{
|
||||||
/* Check if we already found a match */
|
/* Check if we already found a match */
|
||||||
if (NeedsWake)
|
if (NeedsWake)
|
||||||
|
@ -853,7 +854,7 @@ NtDebugContinue(IN HANDLE DebugHandle,
|
||||||
|
|
||||||
/* Compare thread ID and flag */
|
/* Compare thread ID and flag */
|
||||||
if ((DebugEvent->ClientId.UniqueThread ==
|
if ((DebugEvent->ClientId.UniqueThread ==
|
||||||
ClientId.UniqueThread) && (DebugEvent->Flags & 1))
|
AppClientId->UniqueThread) && (DebugEvent->Flags & 1))
|
||||||
{
|
{
|
||||||
/* Remove the event from the list */
|
/* Remove the event from the list */
|
||||||
RemoveEntryList(NextEntry);
|
RemoveEntryList(NextEntry);
|
||||||
|
@ -1034,7 +1035,19 @@ NtSetInformationDebugObject(IN HANDLE DebugHandle,
|
||||||
PreviousMode);
|
PreviousMode);
|
||||||
|
|
||||||
/* Return required length to user-mode */
|
/* 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;
|
if (!NT_SUCCESS(Status)) return Status;
|
||||||
|
|
||||||
/* Open the Object */
|
/* Open the Object */
|
||||||
|
@ -1096,13 +1109,18 @@ NtWaitForDebugEvent(IN HANDLE DebugHandle,
|
||||||
RtlZeroMemory(&WaitStateChange, sizeof(WaitStateChange));
|
RtlZeroMemory(&WaitStateChange, sizeof(WaitStateChange));
|
||||||
|
|
||||||
/* Check if we came with a timeout from user mode */
|
/* Check if we came with a timeout from user mode */
|
||||||
if ((Timeout) && (PreviousMode != KernelMode))
|
if (PreviousMode != KernelMode)
|
||||||
{
|
{
|
||||||
_SEH_TRY
|
_SEH_TRY
|
||||||
{
|
{
|
||||||
/* Make a copy on the stack */
|
if (Timeout)
|
||||||
SafeTimeOut = ProbeForReadLargeInteger(Timeout);
|
{
|
||||||
Timeout = &SafeTimeOut;
|
/* Make a copy on the stack */
|
||||||
|
SafeTimeOut = ProbeForReadLargeInteger(Timeout);
|
||||||
|
Timeout = &SafeTimeOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProbeForWrite(StateChange, sizeof(*StateChange), sizeof(ULONG));
|
||||||
}
|
}
|
||||||
_SEH_HANDLE
|
_SEH_HANDLE
|
||||||
{
|
{
|
||||||
|
@ -1116,12 +1134,6 @@ NtWaitForDebugEvent(IN HANDLE DebugHandle,
|
||||||
KeQuerySystemTime(&StartTime);
|
KeQuerySystemTime(&StartTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the call is from user mode */
|
|
||||||
if (PreviousMode == UserMode)
|
|
||||||
{
|
|
||||||
/* FIXME: Probe the state change structure */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the debug object */
|
/* Get the debug object */
|
||||||
Status = ObReferenceObjectByHandle(DebugHandle,
|
Status = ObReferenceObjectByHandle(DebugHandle,
|
||||||
DEBUG_OBJECT_WAIT_STATE_CHANGE,
|
DEBUG_OBJECT_WAIT_STATE_CHANGE,
|
||||||
|
@ -1268,9 +1280,18 @@ NtWaitForDebugEvent(IN HANDLE DebugHandle,
|
||||||
ObDereferenceObject(DebugObject);
|
ObDereferenceObject(DebugObject);
|
||||||
|
|
||||||
/* Return our wait state change structure */
|
/* Return our wait state change structure */
|
||||||
RtlMoveMemory(StateChange,
|
_SEH_TRY
|
||||||
&WaitStateChange,
|
{
|
||||||
sizeof(DBGUI_WAIT_STATE_CHANGE));
|
RtlCopyMemory(StateChange,
|
||||||
|
&WaitStateChange,
|
||||||
|
sizeof(DBGUI_WAIT_STATE_CHANGE));
|
||||||
|
}
|
||||||
|
_SEH_EXCEPT(_SEH_ExSystemExceptionFilter)
|
||||||
|
{
|
||||||
|
Status = _SEH_GetExceptionCode();
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ ObpDecrementHandleCount(IN PVOID ObjectBody,
|
||||||
ObpDeleteNameCheck(ObjectBody);
|
ObpDeleteNameCheck(ObjectBody);
|
||||||
|
|
||||||
/* Decrease the total number of handles for this type */
|
/* Decrease the total number of handles for this type */
|
||||||
InterlockedDecrement(&ObjectType->TotalNumberOfHandles);
|
InterlockedDecrement((PLONG)&ObjectType->TotalNumberOfHandles);
|
||||||
OBTRACE(OB_HANDLE_DEBUG,
|
OBTRACE(OB_HANDLE_DEBUG,
|
||||||
"%s - Decremented count for: %p. HC LC %lx %lx\n",
|
"%s - Decremented count for: %p. HC LC %lx %lx\n",
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
|
@ -388,7 +388,7 @@ ObpIncrementHandleCount(IN PVOID Object,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Increase total number of handles */
|
/* Increase total number of handles */
|
||||||
InterlockedIncrement(&ObjectType->TotalNumberOfHandles);
|
InterlockedIncrement((PLONG)&ObjectType->TotalNumberOfHandles);
|
||||||
OBTRACE(OB_HANDLE_DEBUG,
|
OBTRACE(OB_HANDLE_DEBUG,
|
||||||
"%s - Incremented count for: %p. Reason: %lx HC LC %lx %lx\n",
|
"%s - Incremented count for: %p. Reason: %lx HC LC %lx %lx\n",
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
|
@ -494,7 +494,7 @@ ObpIncrementUnnamedHandleCount(IN PVOID Object,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Increase total number of handles */
|
/* Increase total number of handles */
|
||||||
InterlockedIncrement(&ObjectType->TotalNumberOfHandles);
|
InterlockedIncrement((PLONG)&ObjectType->TotalNumberOfHandles);
|
||||||
OBTRACE(OB_HANDLE_DEBUG,
|
OBTRACE(OB_HANDLE_DEBUG,
|
||||||
"%s - Incremented count for: %p. UNNAMED HC LC %lx %lx\n",
|
"%s - Incremented count for: %p. UNNAMED HC LC %lx %lx\n",
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
|
|
|
@ -71,7 +71,7 @@ ObpDeallocateObject(IN PVOID Object)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Decrease the total */
|
/* Decrease the total */
|
||||||
InterlockedDecrement(&ObjectType->TotalNumberOfObjects);
|
InterlockedDecrement((PLONG)&ObjectType->TotalNumberOfObjects);
|
||||||
|
|
||||||
/* Check if we have create info */
|
/* Check if we have create info */
|
||||||
if (Header->Flags & OB_FLAG_CREATE_INFO)
|
if (Header->Flags & OB_FLAG_CREATE_INFO)
|
||||||
|
|
|
@ -724,7 +724,7 @@ IntCreateDIBitmap(PDC Dc, const BITMAPINFOHEADER *header,
|
||||||
{
|
{
|
||||||
if (data->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
|
if (data->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))
|
||||||
{
|
{
|
||||||
RGBQUAD *rgb = data->bmiColors;
|
const RGBQUAD *rgb = data->bmiColors;
|
||||||
DWORD col = RGB( rgb->rgbRed, rgb->rgbGreen, rgb->rgbBlue );
|
DWORD col = RGB( rgb->rgbRed, rgb->rgbGreen, rgb->rgbBlue );
|
||||||
|
|
||||||
// Check if the first color of the colormap is black
|
// Check if the first color of the colormap is black
|
||||||
|
|
Loading…
Reference in a new issue