Skip to content

WinSDK: extract System submodule #34147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2020
Merged

Conversation

egorzhdan
Copy link
Contributor

Currently winioctl.h header gets included into WinSDK.WinSock2 via windows.h & winscard.h.
MSDN lists this header in https://docs.microsoft.com/en-us/windows/win32/api/_base/ along with DbgHelp.h, so this change also moves WinSDK.DbgHelp to the System submodule.

@egorzhdan egorzhdan requested a review from compnerd October 1, 2020 17:31
link "DbgHelp.Lib"
}

module IOCtl {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some general rule for naming these modules? I imagine me writing something in Swift and thinking "Ok, MSDN says that these API are defined in winioctl.h, but what import do I need to add?"
At this point it looks easier to just look into modulemap and search for corresponding module.
I am torn between Swiftified module names and "platformish" MSDN-inspired names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lxbndr
From the compilation POV it doesn't really matter which import you add, since all of the submodules are represented by a single underlying Clang module, so importing any submodule (or the entire WinSDK) implicitly imports them all.

From the convenience POV when writing the imports, as you've pointed out, looking for a specific submodule names might be frustrating, if you prefer them over importing the entire module. Ideally your IDE or editor would automatically insert the desired import depending on your preference though, and you wouldn't have to remember the submodule names.
When reading the imports, especially by someone who isn't an expert in the Windows API naming & structure, Swifty names IMO would be easier to understand than some cryptic Windows abbreviations.

There was also a related discussion in #33929, where @compnerd was in favor of the MSDN section names, which don't usually match the header names, and are closer to the Swifty names.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@egorzhdan Oh, thanks for pointing on that discussion. Compnerd's suggestion has sense.

Currently this header gets included into `WinSDK.WinSock2` via windows.h & winscard.h
@compnerd
Copy link
Member

compnerd commented Oct 2, 2020

@swift-ci please smoke test

@compnerd
Copy link
Member

compnerd commented Oct 2, 2020

@swift-ci please test

@compnerd
Copy link
Member

compnerd commented Oct 3, 2020

@swift-ci please test Windows platform

@compnerd
Copy link
Member

compnerd commented Oct 3, 2020

@swift-ci please test Windows Platform

@egorzhdan egorzhdan merged commit 6a43108 into swiftlang:main Oct 3, 2020
@egorzhdan egorzhdan deleted the winsdk-ioctl branch October 4, 2020 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants