mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
[KMTESTS]
- ExResource: Fix a TODO - Fix warnings. All of them. svn path=/branches/GSoC_2011/KMTestSuite/; revision=53322
This commit is contained in:
parent
39c506a4aa
commit
a9bba5d113
6 changed files with 15 additions and 17 deletions
|
@ -29,18 +29,14 @@
|
|||
|
||||
#ifdef KMT_EMULATE_KERNEL
|
||||
#define ok_irql(i)
|
||||
#ifdef __GNUC__
|
||||
#define KIRQL __attribute__((__unused__)) int
|
||||
#elif !defined __GNUC__
|
||||
#define KIRQL int
|
||||
#endif /* !defined __GNUC__ */
|
||||
typedef const UCHAR CUCHAR, *PCUCHAR;
|
||||
typedef ULONG LOGICAL, *PLOGICAL;
|
||||
|
||||
#undef KeRaiseIrql
|
||||
#define KeRaiseIrql(new, old)
|
||||
#define KeRaiseIrql(new, old) *(old) = 123
|
||||
#undef KeLowerIrql
|
||||
#define KeLowerIrql(i)
|
||||
#define KeLowerIrql(i) (void)(i)
|
||||
#define ExAllocatePool(type, size) HeapAlloc(GetProcessHeap(), 0, size)
|
||||
#define ExAllocatePoolWithTag(type, size, tag) HeapAlloc(GetProcessHeap(), 0, size)
|
||||
#define ExFreePool(p) HeapFree(GetProcessHeap(), 0, p)
|
||||
|
|
|
@ -104,7 +104,8 @@ DWORD KmtSendBufferToDriver(IN DWORD ControlCode, IN OUT PVOID Buffer OPTIONAL,
|
|||
extern PKMT_RESULTBUFFER ResultBuffer;
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define KMT_FORMAT(type, fmt, first) __attribute__((__format__(type, fmt, first)))
|
||||
/* TODO: GCC doesn't understand %wZ :( */
|
||||
#define KMT_FORMAT(type, fmt, first) /*__attribute__((__format__(type, fmt, first)))*/
|
||||
#elif !defined __GNUC__
|
||||
#define KMT_FORMAT(type, fmt, first)
|
||||
#endif /* !defined __GNUC__ */
|
||||
|
|
|
@ -136,14 +136,14 @@ Large(
|
|||
}
|
||||
|
||||
#define CheckInterlockedCmpXchg(Function, Type, Print, Val, Cmp, Xchg, \
|
||||
ExpectedValue, ExpectedRet, ...) do \
|
||||
ExpectedValue, ExpectedRet) do \
|
||||
{ \
|
||||
Type Ret##Type = 0; \
|
||||
Type Value##Type = Val; \
|
||||
Status = STATUS_SUCCESS; \
|
||||
_SEH2_TRY { \
|
||||
SaveState(OldState); \
|
||||
Ret##Type = Function(&Value##Type, Xchg, Cmp, ##__VA_ARGS__); \
|
||||
Ret##Type = Function(&Value##Type, Xchg, Cmp); \
|
||||
SaveState(NewState); \
|
||||
CheckState(&OldState, &NewState); \
|
||||
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { \
|
||||
|
@ -236,13 +236,13 @@ Large(
|
|||
} while (0)
|
||||
|
||||
#define CheckInterlockedOpLargeNoRet(Function, Type, Print, Val, Op, \
|
||||
ExpectedValue, ...) do \
|
||||
ExpectedValue) do \
|
||||
{ \
|
||||
Type Value##Type = Val; \
|
||||
Status = STATUS_SUCCESS; \
|
||||
_SEH2_TRY { \
|
||||
SaveState(OldState); \
|
||||
Function(&Value##Type, Op, ##__VA_ARGS__); \
|
||||
Function(&Value##Type, Op); \
|
||||
SaveState(NewState); \
|
||||
CheckState(&OldState, &NewState); \
|
||||
} _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { \
|
||||
|
@ -305,7 +305,7 @@ TestInterlockedFunctional(VOID)
|
|||
|
||||
/* Exchange */
|
||||
CheckInterlockedOp(InterlockedExchange, LONG, "%ld", 5, 8, 8L, 5L);
|
||||
CheckInterlockedOp(InterlockedExchangePointer, PVOID, "%p", (PVOID)700, (PVOID)93, (PVOID)93, (PVOID)700);
|
||||
CheckInterlockedOpNoArg(InterlockedExchangePointer, PVOID, "%p", (PVOID)700, (PVOID)93, (PVOID)700, (PVOID)93);
|
||||
#undef InterlockedExchange
|
||||
#ifdef _M_IX86
|
||||
CheckInterlockedOp(InterlockedExchange, LONG, "%ld", 5, 8, 8L, 5L);
|
||||
|
|
|
@ -25,9 +25,6 @@ typedef struct _ERESOURCE_2K3 {
|
|||
ULONG ContentionCount;
|
||||
USHORT NumberOfSharedWaiters;
|
||||
USHORT NumberOfExclusiveWaiters;
|
||||
#if defined(_WIN64)
|
||||
PVOID Reserved2; /* TODO: not sure if this should be in here for 2k3 */
|
||||
#endif
|
||||
_ANONYMOUS_UNION union {
|
||||
PVOID Address;
|
||||
ULONG_PTR CreatorBackTraceIndex;
|
||||
|
@ -51,7 +48,6 @@ typedef struct _ERESOURCE_2K3 {
|
|||
ok_eq_ulong((Res)->ContentionCount, 0LU); \
|
||||
ok_eq_uint((Res)->NumberOfSharedWaiters, 0); \
|
||||
ok_eq_uint((Res)->NumberOfExclusiveWaiters, 0); \
|
||||
/* ok_eq_pointer((Res)->Reserved2, NULL); */ \
|
||||
ok_eq_pointer((Res)->Address, NULL); \
|
||||
ok_eq_ulongptr((Res)->SpinLock, 0); \
|
||||
} while (0)
|
||||
|
|
|
@ -108,8 +108,11 @@ DEFINE_RELEASE(ReleaseExpNoLower, FALSE, (KeReleaseSpinLockFromDpcLevel)(Spi
|
|||
DEFINE_ACQUIRE(AcquireInStackNoRaise, FALSE, KeAcquireInStackQueuedSpinLockAtDpcLevel(SpinLock, &CheckData->QueueHandle))
|
||||
DEFINE_RELEASE(ReleaseInStackNoRaise, FALSE, KeReleaseInStackQueuedSpinLockFromDpcLevel(&CheckData->QueueHandle))
|
||||
|
||||
/* TODO: test these functions. They behave weirdly, though */
|
||||
#if 0
|
||||
DEFINE_ACQUIRE(AcquireForDpc, TRUE, CheckData->Irql = KeAcquireSpinLockForDpc(SpinLock))
|
||||
DEFINE_RELEASE(ReleaseForDpc, TRUE, KeReleaseSpinLockForDpc(SpinLock, CheckData->Irql))
|
||||
#endif
|
||||
|
||||
DEFINE_ACQUIRE(AcquireInStackForDpc, FALSE, KeAcquireInStackQueuedSpinLockForDpc(SpinLock, &CheckData->QueueHandle))
|
||||
DEFINE_RELEASE(ReleaseInStackForDpc, FALSE, KeReleaseInStackQueuedSpinLockForDpc(&CheckData->QueueHandle))
|
||||
|
|
|
@ -178,11 +178,13 @@ ObtCreateObjectTypes(VOID)
|
|||
{
|
||||
WCHAR DirectoryName[sizeof "\\ObjectTypes\\" - 1];
|
||||
WCHAR TypeName[15];
|
||||
} Name = { L"\\ObjectTypes\\" };
|
||||
} Name;
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
HANDLE ObjectTypeHandle;
|
||||
UNICODE_STRING ObjectPath;
|
||||
|
||||
RtlCopyMemory(&Name.DirectoryName, L"\\ObjectTypes\\", sizeof Name.DirectoryName);
|
||||
|
||||
for (i = 0; i < NUM_OBTYPES; ++i)
|
||||
{
|
||||
Status = RtlStringCbPrintfW(Name.TypeName, sizeof Name.TypeName, L"MyObjectType%x", i);
|
||||
|
|
Loading…
Reference in a new issue