exe2
auto exe2 =
q{--- exe2
@extern(module, "kernel32"):
u8 WriteConsoleA(
void* hConsoleOutput,
u8* lpBuffer,
u32 nNumberOfCharsToWrite,
u32* lpNumberOfCharsWritten,
u64 lpReserved
);
void* GetStdHandle(u32 nStdHandle);
i32 main(void* hInstance, void* hPrevInstance, u8* lpCmdLine, i32 nShowCmd) {
u8[] array = "Hello world";
u32 numWritten;
void* handle = GetStdHandle(0xFFFFFFF5); // STD_OUTPUT_HANDLE
WriteConsoleA(handle, array.ptr, cast(u32)array.length, &numWritten, 0);
return 0;
}
};
tests exe
functionsvariables