+ PVOID Kernel32BaseAddress;
+ PVOID FunctionAddress;
+
+ Status = LdrLoadDll(NULL, NULL, &Kernel32String, &Kernel32BaseAddress);
+
+ if (!NT_SUCCESS(Status))
+ {
+ if (ShowSnaps)
+ DPRINT1("LDR: Unable to load %wZ, Status=0x%08lx\n", &Kernel32String, Status);
+ return Status;
+ }
+
+ Status = LdrGetProcedureAddress(Kernel32BaseAddress,
+ &BaseProcessInitPostImportName,
+ 0,
+ &FunctionAddress);
+
+ if (!NT_SUCCESS(Status))
+ {
+ if (ShowSnaps)
+ DPRINT1("LDR: Unable to find post-import process init function, Status=0x%08lx\n", &Kernel32String, Status);
+ return Status;
+ }
+ Kernel32ProcessInitPostImportFunction = FunctionAddress;
+
+ Status = LdrGetProcedureAddress(Kernel32BaseAddress,
+ &BaseQueryModuleDataName,
+ 0,
+ &FunctionAddress);
+
+ if (!NT_SUCCESS(Status))
+ {
+ if (ShowSnaps)
+ DPRINT1("LDR: Unable to find BaseQueryModuleData, Status=0x%08lx\n", &Kernel32String, Status);
+ return Status;
+ }
+ Kernel32BaseQueryModuleData = FunctionAddress;