winsiderss / phnt

Native API header files for the System Informer project.
https://github.com/winsiderss/systeminformer
MIT License
991 stars 166 forks source link

Thanks and provide some suggestions about this project #3

Closed MouriNaruto closed 5 years ago

MouriNaruto commented 5 years ago

About three years ago, when I am a newbie of C/C++, I wrote an e-mail to @wj32 for asking the permission of using the phnt lib because it contains plenty of NT APIs and it looks fashion.

Dear wj32

I find the phnt lib when I was searching for information about Native API a few days ago.

I modify it and want to add it into my open source project which is distributed under The MIT License.

But the Process Hacker is distributed under the GNU GPL version 3. So I want to ask you for the permission.

I will add your permission text into the readme of my project

I am looking forward to hearing from you.

Yours, Mouri

Here was his reply.

I'm not clear on the copyright status of API headers, but sorry I will not relicense such a big part of the project under MIT. Nevertheless some say that headers cannot be copyrighted and have copied phnt verbatim anyway without asking me. So do what you will...

I'm very grateful to him. And made some modifications and create a repo at https://github.com/Chuyu-Team/NativeLib and distributed under the Public Domain because he said "So do what you will..." to me and it's a way for me to thank him.

All these years have passed. I am not crazy about the NT APIs any more. I have archived the work uses the NT APIs at https://github.com/M2Team/M2-SDK and rewritten my work with the documented APIs.

But I have found the repo recently, and I am happy to know this repo. I want to provide some suggestions to the owner. That's what my modified version does.

  1. Please provide the version which the header files are amalgamated. I don't like include plenty of headers. You can read https://github.com/nlohmann/json/tree/develop/third_party/amalgamate and may get some help.
  2. Use definitions in SDKDDKVer.h instead of something like PHNT_WIN2K.
  3. Compatible with /W4 /WX.

I hope my advice will be adopted.

Mouri

dmex commented 5 years ago

he said "So do what you will..." to me and it's a way for me to thank him.

That's a figure of speech in english that means you do not consent? 🤔

Please provide the version which the header files are amalgamated.

I can understand version numbers in a desktop program but not so much for header files. Can you give me a decent use case for version numbers in header files?

I don't like include plenty of headers.

You only need to include two headers per the documentation? If you're including more than these two headers then you're not using this repository correctly:

#include <phnt_windows.h>
#include <phnt.h>

Use definitions in SDKDDKVer.h instead of something like PHNT_WIN2K.

This would be a problem because this repository doesn't have a msvc solution with a minimum SDK requirement. The other problem with using SDK versioning is that we introduce a dependency on Microsoft first updating the SDK versioning (which isn't always timely and/or reliable due to compat) and we won't ever be able to add definitions for new builds of Windows until after a new SDK is released.

Compatible with /W4 /WX.

No. I can guarantee /W3 (production quality) which is the default. If someone wants to manually enable /W4 for their project then it's assumed they require/need informational warnings and it would be counter intuitive overriding their desired configuration and disabling those informational warnings.

MouriNaruto commented 5 years ago

@dmex

I understand all except the following things:

That's a figure of speech in english that means you do not consent?

I don't know what your meaning because I am not good at English and wj32's reply is read by my friend which is good at English and translate to me. I can write an English letter easily but not good at to understand the reply. Although I can understand some of the replies now. If I misunderstood his mean( I think his mean is that I can do any thing like other people who is not ask him for the permission, so I think he is a good man and express my gratitude. ), I will feel very sorry.

You only need to include two headers per the documentation?

I think you misunderstood my mean. I mean I don't want to include plenty of headers in the repository.

Mouri.

dmex commented 5 years ago

wj32's reply is read by my friend which is good at English and translate to me.

I figured that was the case.

I don' want to include plenty of headers in the repository.

You can add this repository as a git sub module so you don't have to copy files?

MouriNaruto commented 5 years ago

@dmex

You can add this repository as a git sub module so you don't have to copy files?

Also, I have some new ideas.

  1. How do you think about separating the PHNT's definitions of Kernel Mode from User Mode?
  2. "ntzwapi.h" should be improved. We can set the target OS version by PHNT macros but the content in "ntzwapi.h" is not under the management of PHNT macros.

Mouri