Closed rumia-san closed 4 years ago
Hm, are you sure it would be a good idea to include it in header?
In almost all cases it will be something like this:
...
And what about kernel? There are no minwindef.h. Should we include wdm.h? Or ntddk, or something else? It's quiet questionable... What are you think about it?
Oh, I'm sorry for that I'm just using the user mode and I have no knowledge of the kernel mode programming :facepalm: perhaps we could use conditional compile such as
#ifndef _KERNEL_MODE
#include <windef.h>
#else
#include <wdm.h>
#endif
I'm sorry I have never touched kernel mode programming, thus I am unable to give further suggestions.., What is your opinion?
@rumia-san, it's a variant, but I think it would be better to avoid include windef.h/windows.h/wdm.h in header and include them in place we're including HookLib.h (user should include it himself). And in many cases these headers will be already included. And this approach helps us to avoid multiple headers inclusion. Wouldn't it better?
Yeah, There is no concern for me. Thanks for replying .I'm closing this PR.
Hi, Александр, I'm using your library in my code. I think it is powerful and easy to use : )
But I found that the
HookLib.h
uses macros defined in windows headers such asHMODULE
,PVOID
, etc. without#include <windows.h>
In this case, If I
#include HookLib.h
in my project, the VS intellisense will complainsundefined identifier
.If I
#include "HookLib.h"
before#include <windows.h>
, the compiler will complains "E0020 undefined identifier" as well.Thus, I think it would be better if we add
#include <windows.h>
toHookLib.h
Best regards, Rumia