InsertTailList(&Peb->Ldr->InLoadOrderModuleList,
&NtModule->InLoadOrderLinks);
InsertTailList(&Peb->Ldr->InInitializationOrderModuleList,
- &NtModule->InInitializationOrderModuleList);
+ &NtModule->InInitializationOrderLinks);
- #if DBG || defined(KDBG)
-
- LdrpLoadUserModuleSymbols(NtModule);
-
- #endif /* DBG || KDBG */
-
/* add entry for executable (becomes first list entry) */
ExeModule = (PLDR_DATA_TABLE_ENTRY)
RtlAllocateHeap(Peb->ProcessHeap,
DPRINT1("LdrFixupImports failed for %wZ, status=%x\n", &(*Module)->BaseDllName, Status);
return Status;
}
- #if DBG || defined(KDBG)
- LdrpLoadUserModuleSymbols(*Module);
- #endif /* DBG || KDBG */
+
RtlEnterCriticalSection(NtCurrentPeb()->LoaderLock);
InsertTailList(&NtCurrentPeb()->Ldr->InInitializationOrderModuleList,
- &(*Module)->InInitializationOrderModuleList);
+ &(*Module)->InInitializationOrderLinks);
RtlLeaveCriticalSection (NtCurrentPeb()->LoaderLock);
}
return STATUS_SUCCESS;
//
typedef struct _PEB
{
- UCHAR InheritedAddressSpace;
- UCHAR ReadImageFileExecOptions;
- UCHAR BeingDebugged;
+ BOOLEAN InheritedAddressSpace;
+ BOOLEAN ReadImageFileExecOptions;
+ BOOLEAN BeingDebugged;
#if (NTDDI_VERSION >= NTDDI_WS03)
- struct
+ union
{
- UCHAR BitField;
+ BOOLEAN ImageUsesLargePages:1;
++ BOOLEAN BitField;
+ struct
+ {
+ UCHAR ImageUsesLargePages:1;
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
- UCHAR IsProtectedProcess:1;
- UCHAR IsLegacyProcess:1;
- UCHAR IsImageDynamicallyRelocated:1;
- UCHAR SkipPatchingUser32Forwarders:1;
- UCHAR SpareBits:3;
+ BOOLEAN IsProtectedProcess:1;
+ BOOLEAN IsLegacyProcess:1;
+ BOOLEAN SpareBits:5;
++ BOOLEAN IsProtectedProcess:1;
++ BOOLEAN IsLegacyProcess:1;
++ BOOLEAN IsImageDynamicallyRelocated:1;
++ BOOLEAN SkipPatchingUser32Forwarders:1;
++ BOOLEAN SpareBits:3;
#else
- UCHAR SpareBits:7;
- BOOLEAN SpareBits:7;
++ BOOLEAN SpareBits:7;
#endif
+ };
};
#else
BOOLEAN SpareBool;
#include <string.h>
/* FIXME: add more architectures. Is there a way to specify this in GCC? */
- #ifdef _X86_
- #define UNALIGNED
+ #if defined(_M_AMD64)
+ #undef UNALIGNED
+ #define UNALIGNED __unaligned
#else
+#undef UNALIGNED
#define UNALIGNED
#endif
/* INTERNAL KERNEL FUNCTIONS ************************************************/
+ VOID
+ NTAPI
+ CPUID(
+ IN ULONG InfoType,
+ OUT PULONG CpuInfoEax,
+ OUT PULONG CpuInfoEbx,
+ OUT PULONG CpuInfoEcx,
+ OUT PULONG CpuInfoEdx
+ );
+
+ LONGLONG
+ FASTCALL
+ RDMSR(
+ IN ULONG Register
+ );
+
+ VOID
+ NTAPI
+ WRMSR(
+ IN ULONG Register,
+ IN LONGLONG Value
+ );
+
/* Finds a new thread to run */
-NTSTATUS
+LONG_PTR
FASTCALL
KiSwapThread(
IN PKTHREAD Thread,
IN PSTRING Data,
IN PCONTEXT Context)
{
+ PDBGKD_READ_MEMORY64 ReadMemory = &State->u.ReadMemory;
STRING Header;
- ULONG Length = State->u.ReadMemory.TransferCount;
- NTSTATUS Status = STATUS_SUCCESS;
+ ULONG Length = ReadMemory->TransferCount;
+ ULONG64 TargetBaseAddress = State->u.ReadMemory.TargetBaseAddress;
+ /* Setup the header */
+ Header.Length = sizeof(DBGKD_MANIPULATE_STATE64);
+ Header.Buffer = (PCHAR)State;
+ ASSERT(Data->Length == 0);
+
/* Validate length */
if (Length > (PACKET_MAX_SIZE - sizeof(DBGKD_MANIPULATE_STATE64)))
{
ExFreeArmPoolWithTag(P, 0);
}
- IN ULONG NumberOfBytes)
+ /*
+ * @unimplemented
+ */
+ SIZE_T
+ NTAPI
+ ExQueryPoolBlockSize(IN PVOID PoolBlock,
+ OUT PBOOLEAN QuotaCharged)
+ {
+ //
+ // Not implemented
+ //
+ UNIMPLEMENTED;
+ return FALSE;
+ }
+
+ /*
+ * @implemented
+ */
+
+ PVOID
+ NTAPI
+ ExAllocatePoolWithQuota(IN POOL_TYPE PoolType,
- IN ULONG NumberOfBytes,
++ IN SIZE_T NumberOfBytes)
+ {
+ //
+ // Allocate the pool
+ //
+ return ExAllocatePoolWithQuotaTag(PoolType, NumberOfBytes, 'enoN');
+ }
+
+ /*
+ * @implemented
+ */
+ PVOID
+ NTAPI
+ ExAllocatePoolWithTagPriority(IN POOL_TYPE PoolType,
+ IN SIZE_T NumberOfBytes,
+ IN ULONG Tag,
+ IN EX_POOL_PRIORITY Priority)
+ {
+ //
+ // Allocate the pool
+ //
+ UNIMPLEMENTED;
+ return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag);
+ }
+
+ /*
+ * @implemented
+ */
+ PVOID
+ NTAPI
+ ExAllocatePoolWithQuotaTag(IN POOL_TYPE PoolType,
++ IN SIZE_T NumberOfBytes,
+ IN ULONG Tag)
+ {
+ //
+ // Allocate the pool
+ //
+ UNIMPLEMENTED;
+ return ExAllocatePoolWithTag(PoolType, NumberOfBytes, Tag);
+ }
+
/* EOF */