#define _WIN32_WINNT 0x501
#include <windows.h>
#include <stdio.h>

typedef struct _UNICODE_STRING {
        USHORT Length;
        USHORT MaximumLength;
        PWSTR Buffer;
} UNICODE_STRING;

typedef UNICODE_STRING *PUNICODE_STRING;

VOID (__stdcall *LdrLoadDl)(IN PWCHAR PathToFile OPTIONAL,IN ULONG Flags OPTIONAL,IN PUNICODE_STRING ModuleFileName,OUT PHANDLE ModuleHandle);

typedef VOID (__stdcall* LDRLOADDLL)(IN PWCHAR,IN ULONG,IN PUNICODE_STRING,OUT PHANDLE);

VOID (__stdcall *RtlInitUnicodeString)(IN OUT PUNICODE_STRING DestinationString,IN PCWSTR SourceString);

typedef VOID (__stdcall* RTLINITUNICODESTRING)(IN OUT PUNICODE_STRING,IN PCWSTR);

int main(){
	
	// Load function pointers
	RtlInitUnicodeString = (RTLINITUNICODESTRING)GetProcAddress(LoadLibrary("ntdll.dll"), "RtlInitUnicodeString");
	LdrLoadDl = (LDRLOADDLL)GetProcAddress(LoadLibrary("ntdll.dll"), "LdrLoadDll");

	UNICODE_STRING UnicodeDllName;
	
	// Generate unicode string
	RtlInitUnicodeString(&UnicodeDllName, L"mshtml.dll");
	
	DWORD dwHandle = 0;

	// Load by native API call
	LdrLoadDl(NULL, NULL, &UnicodeDllName, (PVOID*)&dwHandle);

	return 0;
}
