_CreateProcess __CreateProcess = NULL;
	__CreateProcess = (_CreateProcess)GetProcAddress(GetModuleHandle("Kernel32.dll"), "CreateProcessA");

what is this (_CreateProcess) in the code??? is this a cast types?

__CreateProcess = (_CreateProcess)GetProcAddress(GetModuleHandle("Kernel32.dll"), "CreateProcessA");

Recommended Answers

All 4 Replies

what is this (_CreateProcess) in the code??? is this a cast types?

Yes it is a type cast. Why would you want be doing that kind of thing?
You can simply call CreateProcess(...) with the arguments it takes, without hassling with function pointers at all.

thank you!

thread solved

Why would you want be doing that kind of thing?

Good question it looks a lot like a HOOK and dll injection example piece of code.

Although, the fact I recognise it is probably not a good thing ;)

thank you!

thread solved

Then why didn't you mark it solved?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.