microsoft / win32metadata

Tooling to generate metadata for Win32 APIs in the Windows SDK.
Other
1.34k stars 117 forks source link

Namespaces need better names #388

Closed kennykerr closed 2 years ago

kennykerr commented 3 years ago

I can't quite put my finger on what Intl stands for and considering we have wordy namespaces like SettingsManagementInfrastructure and WindowsMediaLibrarySharingServices, I expect we can do better than Intl.

sotteson1 commented 3 years ago

I didn't think the normal abbreviation i18n for Internationalization was a good choice. :) I'll just use the full word. All of the shortened names came from the "tech roots" from the docs. Some I've gotten around to changing and some I haven't. I'm not tied to any of them, including the ones that might be too long. I would love it if there was someone who wanted to go through them all and make them somewhat standardized and consistent. @mikebattista, any ideas on how to consistently name everything?

kennykerr commented 3 years ago

đŸ˜„ A review of the names would be lovely. They are pretty inconsistent.

kennykerr commented 3 years ago

We need to get these cleaned up. It might also be a good idea to group them e.g. all the DirectXxx namespaces as namespaces within a new DirectX namespace. It also bothers me that some have Windows in the leaf name e.g. WindowsClustering and some don't e.g. Packaging. I'd love these namespaces to look more like the WinRT namespaces.

@jonwis can you help review the namespace names for the Win32 metadata? Otherwise, I'm happy to offer up a more consistent list of names.

Here are the current namespaces:

Windows.Win32.ActiveDirectory
Windows.Win32.AllJoyn
Windows.Win32.Antimalware
Windows.Win32.ApplicationInstallationAndServicing
Windows.Win32.AppxPackaging
Windows.Win32.Audio
Windows.Win32.Automation
Windows.Win32.BackgroundIntelligentTransferService
Windows.Win32.Bluetooth
Windows.Win32.CloudFilters
Windows.Win32.Com
Windows.Win32.ComponentServices
Windows.Win32.Compression
Windows.Win32.Controls
Windows.Win32.CoreAudio
Windows.Win32.DataDeduplication
Windows.Win32.DataExchange
Windows.Win32.Debug
Windows.Win32.DeveloperLicensing
Windows.Win32.DeviceAccess
Windows.Win32.DeviceAndDriverInstallation
Windows.Win32.Dhcp
Windows.Win32.Direct2D
Windows.Win32.Direct3D10
Windows.Win32.Direct3D11
Windows.Win32.Direct3D12
Windows.Win32.Direct3D9
Windows.Win32.Direct3DHlsl
Windows.Win32.DirectComposition
Windows.Win32.DirectDraw
Windows.Win32.DirectML
Windows.Win32.DirectManipulation
Windows.Win32.DirectShow
Windows.Win32.DirectWrite
Windows.Win32.DisplayDevices
Windows.Win32.DistributedFileSystem
Windows.Win32.Dns
Windows.Win32.Dwm
Windows.Win32.Dxgi
Windows.Win32.EnhancedStorage
Windows.Win32.Etw
Windows.Win32.ExtensibleAuthenticationProtocol
Windows.Win32.Fax
Windows.Win32.FileSeverResourceManager
Windows.Win32.FileSystem
Windows.Win32.GameMode
Windows.Win32.GamingDeviceInfo
Windows.Win32.Gdi
Windows.Win32.GroupPolicyManagementConsole
Windows.Win32.HardwareCounterProfiling
Windows.Win32.HiDpi
Windows.Win32.Hid
Windows.Win32.HtmlHelp
Windows.Win32.Http
Windows.Win32.Hypervisor
Windows.Win32.IMapi
Windows.Win32.IScsiDisc
Windows.Win32.IndexServer
Windows.Win32.InkInput
Windows.Win32.InstallableFileSystems
Windows.Win32.InteractionContext
Windows.Win32.Intl
Windows.Win32.IpHelper
Windows.Win32.Js
Windows.Win32.Kernel
Windows.Win32.KeyboardAndMouseInput
Windows.Win32.Ldap
Windows.Win32.LegacyWindowsEnvironmentFeatures
Windows.Win32.Location
Windows.Win32.MachineLearning
Windows.Win32.Magnification
Windows.Win32.Mapi
Windows.Win32.Mbn
Windows.Win32.MediaFoundation
Windows.Win32.MediaTransport
Windows.Win32.MenusAndResources
Windows.Win32.Mib
Windows.Win32.MixedReality
Windows.Win32.Mmc
Windows.Win32.MobileBroadband
Windows.Win32.MobileDeviceManagementRegistration
Windows.Win32.Monitor
Windows.Win32.Multicast
Windows.Win32.Multimedia
Windows.Win32.NativeWiFi
Windows.Win32.NetBios
Windows.Win32.NetManagement
Windows.Win32.NetShell
Windows.Win32.NetworkDiagnosticsFramework
Windows.Win32.NetworkDrivers
Windows.Win32.NetworkListManager
Windows.Win32.NetworkPolicyServer
Windows.Win32.OfflineFiles
Windows.Win32.OpenGL
Windows.Win32.OperationRecorder
Windows.Win32.OtherDeviceTechnologies
Windows.Win32.P2P
Windows.Win32.Packaging
Windows.Win32.ParentalControls
Windows.Win32.PasswordManagement
Windows.Win32.Perf
Windows.Win32.PerformanceLogAndAlerts
Windows.Win32.PhotoAcquire
Windows.Win32.PointerInput
Windows.Win32.Policy
Windows.Win32.Power
Windows.Win32.PrintDocs
Windows.Win32.ProcessSnapshotting
Windows.Win32.ProcessStatus
Windows.Win32.ProjectedFileSystem
Windows.Win32.QualityOfService
Windows.Win32.RadialInput
Windows.Win32.Recovery
Windows.Win32.RemoteAssistance
Windows.Win32.RemoteDesktopServices
Windows.Win32.RemoteDifferentialCompression
Windows.Win32.RestartManager
Windows.Win32.RightsManagement
Windows.Win32.RoutingAndRemoteAccessService
Windows.Win32.Rpc
Windows.Win32.Search
Windows.Win32.Security
Windows.Win32.Sensors
Windows.Win32.SerialController
Windows.Win32.SettingsManagementInfrastructure
Windows.Win32.Shell
Windows.Win32.Snmp
Windows.Win32.SoftwareDevice
Windows.Win32.Speech
Windows.Win32.StreamingMedia
Windows.Win32.StructuredStorage
Windows.Win32.Sync
Windows.Win32.SystemEventNotificationService
Windows.Win32.SystemRestore
Windows.Win32.SystemServices
Windows.Win32.TabletPC
Windows.Win32.Tapi
Windows.Win32.TaskScheduler
Windows.Win32.TextServices
Windows.Win32.TilesBadgesNotifications
Windows.Win32.TitleCallableUI
Windows.Win32.ToolHelp
Windows.Win32.TouchInput
Windows.Win32.TpmBaseServices
Windows.Win32.UIAnimation
Windows.Win32.UPnp
Windows.Win32.UsbDrivers
Windows.Win32.UserAccessLogging
Windows.Win32.Vhd
Windows.Win32.WebDav
Windows.Win32.WebSock
Windows.Win32.Wia
Windows.Win32.WinInet
Windows.Win32.WinRT
Windows.Win32.WinSock
Windows.Win32.WindowsAccessibility
Windows.Win32.WindowsAddressBook
Windows.Win32.WindowsAndMessaging
Windows.Win32.WindowsBiometricFramework
Windows.Win32.WindowsClustering
Windows.Win32.WindowsColorSystem
Windows.Win32.WindowsConnectNow
Windows.Win32.WindowsConnectionManager
Windows.Win32.WindowsContacts
Windows.Win32.WindowsDeploymentServices
Windows.Win32.WindowsDesktopSharing
Windows.Win32.WindowsErrorReporting
Windows.Win32.WindowsEventCollector
Windows.Win32.WindowsEventLog
Windows.Win32.WindowsFiltering
Windows.Win32.WindowsFirewall
Windows.Win32.WindowsImagingComponent
Windows.Win32.WindowsInformationProtection
Windows.Win32.WindowsMediaDeviceManager
Windows.Win32.WindowsMediaFormat
Windows.Win32.WindowsMediaLibrarySharingServices
Windows.Win32.WindowsMediaPlayer
Windows.Win32.WindowsNetworkVirtualization
Windows.Win32.WindowsNetworking
Windows.Win32.WindowsPortableDevices
Windows.Win32.WindowsProgramming
Windows.Win32.WindowsPropertiesSystem
Windows.Win32.WindowsRemoteManagement
Windows.Win32.WindowsRibbon
Windows.Win32.WindowsServerBackup
Windows.Win32.WindowsSetupAndMigration
Windows.Win32.WindowsStationsAndDesktops
Windows.Win32.WindowsSubsystemForLinux
Windows.Win32.WindowsSync
Windows.Win32.WindowsSystemAssessmentTool
Windows.Win32.WindowsUpdateAgent
Windows.Win32.WindowsWebServices
Windows.Win32.Wmi
Windows.Win32.WpfBitmapEffects
Windows.Win32.XAudio2
Windows.Win32.XInput
Windows.Win32.XamlDiagnostics
Windows.Win32.Xblidp
Windows.Win32.XmlHttpExtendedRequest
Windows.Win32.Xps
jonwis commented 3 years ago

I've forwarded to the Windows API Design group who should descend on the list with opinions. :)

I agree that putting "Windows.Foo.WindowsBar" is not great. Can the ".WindowsBar" part be converted to just ".Bar" ? There are a few outliers - WindowsSubsystemForLinux is a concrete name, as is WindowsMediaPlayer.

WebDav, WinSock, WinInet, WebSock (should be WebSocket?) should probably go under Windows.Win32.Networking

sotteson1 commented 3 years ago

The fix for #396 also just added Windows.Win32.InternetExplorer in case someone thinks it needs a different name.

sotteson1 commented 3 years ago

I've forwarded to the Windows API Design group who should descend on the list with opinions. :)

I agree that putting "Windows.Foo.WindowsBar" is not great. Can the ".WindowsBar" part be converted to just ".Bar" ? There are a few outliers - WindowsSubsystemForLinux is a concrete name, as is WindowsMediaPlayer.

WebDav, WinSock, WinInet, WebSock (should be WebSocket?) should probably go under Windows.Win32.Networking

Sure, I can change the namespaces however we want. One clarification: Did you mean collapse WebDav, WinSock, WinInet, WebSocket into just Windows.Win32.Networking, or did you mean make them sub namespaces under Windows.Win32.Networking?

FrancisHogle commented 3 years ago

It seems weird that we are mixing descriptive names and acronyms.

Should we have a "no acronyms" guideline and exception process?

jonwis commented 3 years ago

Did you mean collapse WebDav, WinSock, WinInet, WebSocket into just Windows.Win32.Networking

Sub-namespaces, so Windows.Win32.Networking.WinSock

(Also - we should figure out how to upstream the name bucketing into the OS build so people working on new APIs know it's coming.)

jonwis commented 3 years ago

Should we have a "no acronyms" guideline and exception process?

Yes - our internal (coming soon, not-internal!) guidelines say that acronyms should only be used when they are industry standards. https://osgwiki.com/wiki/WinRT_API_Design_Guidelines#Using_Abbreviations_and_Acronyms says:

In general, do not use abbreviations or acronyms in identifiers. As stated earlier, it is more important for names to be readable than it is for them to be brief. It is equally important not to use abbreviations and acronyms that are not generally understood—that is, do not use anything that the large majority of people who are not experts in a given field would not know the meaning of immediately.

kennykerr commented 3 years ago

Thanks, here's a first pass at applying some of this feedback. I'm not attached to any names, but we derived them primarily from documentation to help developers make connections easily. I'm also in favor of avoiding acronyms but there are of course many well known acronyms in popular use in Win32 that would be strange to lose. We are also dealing with a closed set of APIs, so we mainly need practical suggestions on better names, if desired.

So pile on below with any suggestions and I can tweak this table and then Steve can make the changes as needed. Thanks!

Before After
ActiveDirectory ActiveDirectory
AllJoyn AllJoyn
Antimalware Antimalware
ApplicationInstallationAndServicing ApplicationInstallationAndServicing
AppxPackaging Packaging.Appx
Audio Audio.DirectMusic
Automation Automation
BackgroundIntelligentTransferService Networking.Bits
Bluetooth Networking.Bluetooth
CloudFilters Storage.CloudFilters
Com Com
ComponentServices ComponentServices
Compression Compression
Controls UI.Controls
CoreAudio Audio.CoreAudio
DataDeduplication DataDeduplication
DataExchange DataExchange
Debug Diagnostics
DeveloperLicensing DeveloperLicensing
DeviceAccess DeviceAccess
DeviceAndDriverInstallation DeviceAndDriverInstallation
Dhcp Networking.Dhcp
Direct2D Graphics.Direct2D
Direct3D10 Graphics.Direct3D10
Direct3D11 Graphics.Direct3D11
Direct3D12 Graphics.Direct3D12
Direct3D9 Graphics.Direct3D9
Direct3DHlsl Graphics.Hlsl
DirectComposition Graphics.DirectComposition
DirectDraw Graphics.DirectDraw
DirectML DirectML
DirectManipulation Graphics.DirectManipulation
DirectShow Graphics.DirectShow
DirectWrite Graphics.DirectWrite
DisplayDevices UI.DisplayDevices
DistributedFileSystem Storage.DistributedFileSystem
Dns Networking.Dns
Dwm Graphics.Dwm
Dxgi Graphics.Dxgi
EnhancedStorage Storage.EnhancedStorage
Etw Diagnostics.Etw
ExtensibleAuthenticationProtocol ExtensibleAuthenticationProtocol
Fax Fax
FileSeverResourceManager Storage.FileServerResourceManager
FileSystem Storage.FileSystem
GameMode Gaming
GamingDeviceInfo Gaming
Gdi Graphics.Gdi
GroupPolicyManagementConsole GroupPolicyManagementConsole
HardwareCounterProfiling HardwareCounterProfiling
HiDpi UI.HiDpi
Hid Hid
HtmlHelp HtmlHelp
Http Networking.Http
Hypervisor Hypervisor
IMapi Storage.Imapi
IScsiDisc Storage.IscsiDisc
IndexServer Storage.IndexServer
InkInput UI.InkInput
InstallableFileSystems Storage.InstallableFileSystems
InteractionContext InteractionContext
Intl Globalization
IpHelper Networking.IpHelper
Js Js
Kernel Kernel
KeyboardAndMouseInput UI.KeyboardAndMouseInput
Ldap Networking.Ldap
LegacyWindowsEnvironmentFeatures LegacyWindowsEnvironmentFeatures
Location Location
MachineLearning MachineLearning
Magnification UI.Magnification
Mapi Networking.Mapi
Mbn Networking.Connectivity
MediaFoundation MediaFoundation
MediaTransport MediaTransport
MenusAndResources UI.MenusAndResources
Mib Networking.Mib
MixedReality MixedReality
Mmc Mmc
MobileBroadband Networking.Connectivity
MobileDeviceManagementRegistration MobileDeviceManagementRegistration
Monitor Monitor
Multicast Networking.Multicast
Multimedia Multimedia
NativeWiFi Networking.WiFi
NetBios Networking.NetBios
NetManagement Networking.Management
NetShell Networking.NetShell
NetworkDiagnosticsFramework Networking.DiagnosticsFramework
NetworkDrivers Networking.Drivers
NetworkListManager Networking.ListManager
NetworkPolicyServer Networking.PolicyServer
OfflineFiles Storage.OfflineFiles
OpenGL Graphics.OpenGL
OperationRecorder OperationRecorder
OtherDeviceTechnologies OtherDeviceTechnologies
P2P Networking.P2P
Packaging Packaging.Opc
ParentalControls ParentalControls
PasswordManagement PasswordManagement
Perf Performance
PerformanceLogAndAlerts Performance.LogAndAlerts
PhotoAcquire PhotoAcquire
PointerInput UI.PointerInput
Policy Policy
Power Power
PrintDocs PrintDocs
ProcessSnapshotting ProcessSnapshotting
ProcessStatus ProcessStatus
ProjectedFileSystem Storage.ProjectedFileSystem
QualityOfService QualityOfService
RadialInput UI.RadialInput
Recovery Recovery
RemoteAssistance RemoteAssistance
RemoteDesktopServices RemoteDesktopServices
RemoteDifferentialCompression RemoteDifferentialCompression
RestartManager RestartManager
RightsManagement RightsManagement
RoutingAndRemoteAccessService RoutingAndRemoteAccessService
Rpc Rpc
Search Search
Security Security
Sensors Sensors
SerialController SerialController
SettingsManagementInfrastructure SettingsManagementInfrastructure
Shell Shell
Snmp Networking.Snmp
SoftwareDevice SoftwareDevice
Speech Speech
StreamingMedia StreamingMedia
StructuredStorage Storage.StructuredStorage
Sync Sync
SystemEventNotificationService SystemEventNotificationService
SystemRestore SystemRestore
SystemServices SystemServices
TabletPC TabletPC
Tapi Tapi
TaskScheduler TaskScheduler
TextServices TextServices
TilesBadgesNotifications UI.Notifications
TitleCallableUI Gaming
ToolHelp ToolHelp
TouchInput UI.TouchInput
TpmBaseServices TpmBaseServices
UIAnimation UI.Animation
UPnp UPnp
UsbDrivers UsbDrivers
UserAccessLogging UserAccessLogging
Vhd Vhd
WebDav Networking.WebDav
WebSock Networking.WebSocket
Wia Wia
WinInet Networking.WinInet
WinRT WinRT
WinSock Networking.WinSock
WindowsAccessibility Accessibility
WindowsAddressBook AddressBook
WindowsAndMessaging UI.WindowsAndMessaging
WindowsBiometricFramework BiometricFramework
WindowsClustering Clustering
WindowsColorSystem UI.ColorSystem
WindowsConnectNow ConnectNow
WindowsConnectionManager ConnectionManager
WindowsContacts Contacts
WindowsDeploymentServices DeploymentServices
WindowsDesktopSharing DesktopSharing
WindowsErrorReporting ErrorReporting
WindowsEventCollector EventCollector
WindowsEventLog EventLog
WindowsFiltering Filtering
WindowsFirewall Firewall
WindowsImagingComponent Imaging
WindowsInformationProtection InformationProtection
WindowsMediaDeviceManager MediaDeviceManager
WindowsMediaFormat MediaFormat
WindowsMediaLibrarySharingServices MediaLibrarySharingServices
WindowsMediaPlayer MediaPlayer
WindowsNetworkVirtualization Networking.Virtualization
WindowsNetworking Networking
WindowsPortableDevices PortableDevices
WindowsProgramming Programming
WindowsPropertiesSystem PropertiesSystem
WindowsRemoteManagement RemoteManagement
WindowsRibbon Ribbon
WindowsServerBackup ServerBackup
WindowsSetupAndMigration SetupAndMigration
WindowsStationsAndDesktops StationsAndDesktops
WindowsSubsystemForLinux SubsystemForLinux
WindowsSync Sync
WindowsSystemAssessmentTool SystemAssessmentTool
WindowsUpdateAgent UpdateAgent
WindowsWebServices WebServices
Wmi Wmi
WpfBitmapEffects UI.Wpf
XAudio2 Audio.XAudio2
XInput UI.XInput
XamlDiagnostics UI.XamlDiagnostics
Xblidp Gaming
XmlHttpExtendedRequest Xml
Xps Xps
mikebattista commented 3 years ago

Generally looks good. A few comments:

mikebattista commented 3 years ago

Also there's an AppxPackaging namespace and a Packaging namespace which seems odd. Should they be merged? Should we switch Appx to Msix? What about Windows.Win32.Packaging.Appx and Windows.Win32.Packaging.Opc?

IpHelper should probably go under .Networking as well. XmlHttpExtendedRequest would be another candidate for Networking. Also Mib, Snmp, and WebDAV.

We have Mbn and MobileBroadband which I believe are the same family of APIs. We should merge them all under MobileBroadband. Then MobileBroadband should probably also go under .Networking. The WinRT equivalent of these are under Windows.Networking.Connectivity per https://docs.microsoft.com/en-us/windows/win32/api/mbnapi/nn-mbnapi-imbnconnectionmanager.

If we put KeyboardAndMouseInput and InkInput under .UI, we should also put TouchInput under .UI, and maybe even RadialInput as well. PointerInput too. Also consider Speech.

If we have UI.Wpf for WpfBitmapEffects, XamlDiagnostics should probably go under UI.Xaml or something similar.

keith-horton commented 3 years ago

Lots of comments on Networking - we still need to rationalize this :)

First: how are we wanting users to discover names? I ask because we have many "networking related" APIs for different purposes. Generally: a) network management related APIs: for example: DHCP, DNS, IpHelper APIs -- these are not for using the network (for sending or receiving data), these are for managing network configurations (either to just query for properties or to actually modify them) b) network I/O related APIs: for example, BITS, WinInet, Winsock -- these are abstractions above the underlying network infrastructure - which is what (a) is targeting. these are all about IO over a network.

If we want to keep this "flatter and simpler" then we can dump everything related to a network under "Networking". If we want to guide users into APIs that they would be looking for (and thus give them a shorter list to choose from), we would split them up to something like Windows.Win32.NetworkManagement vs. Windows.Win32.Networking. Or something along those lines.

keith-horton commented 3 years ago

Second comment, I'll go into details of various names.

  1. These don't make sense to me, as in I know know which of our many networking related APIs they refer:
    • Windows.Win32.Http (Networking.Http) : we have various HTTP APIs (I see WinInet listed separately so it's not that one). Which is this? Is it WinHttp? We'll need to be precise.
    • Windows.Win32.NetManagement (Networking.Management) - we have many management related APIs. which is this trying to cover? We'll need to be precise since this is already confusing me
    • Windows.Win32.NetworkDrivers (Networking.Drivers) - which APIs are these supposed to be capturing?
    • Windows.Win32.WindowsNetworking (Networking) - as above, super confused as to which APIs these are supposed to be :)
    • Windows.Win32.Mib - is this related to the cellular or general networking MIB concepts, or something not related to networking?
    • Windows.Win32.Multicast (Networking.Multicast) - what APIs are intended to be here? we have many Winsock APIs for multicast networking.
    • Windows.Win32.WebSock (Networking.WebSock) - if this is related to websockets (presumably they are?) then please call it WebSocket
    • Windows.Win32.WindowsFiltering - the only Windows filtering APIs I'm aware of are kernel APIs to build a kernel driver. presumably we aren't also trying to cover kernel APIs? What APIs are intended here?
    • Networking.Ldap - we have many APIs that can go over a network (e.g. RPC), I don't know that we want to put any API that could go over the network under "Networking"? Or maybe we do and we need to review all of them again?
    • Networking.NetShell - the only 'netshell' I'm aware of is a command line tool (netsh). I don't know what APIs we would put under here (?)
    • Windows.Win32.WindowsConnectionManager (ConnectionManager) - the "Windows Connection Manager" APIs are networking-specific APIs and have that specific name "Windows Connection Manager". These are very old and I don't know of any modern reason to call them. IMHO we wouldn't "elevate" them to modern developers as useful or interesting. I would rather just list APIs we want people to use.
    • Windows.Win32.NetworkListManager (Networking.ListManager) - this I'm assuming captures the INetworkListManager COM API. Since "NetworkListManager" is the name of the COM API, I would assume we would keep that specific naming in this namespace? I don't know it's useful to truncate formal names - IMHO that makes it even more difficult to find names.
    • Windows.Win32.NativeWiFi (Networking.NativeWiFi) - please don't call this "NativeWiFi". the work "Native" came about long ago from the many iterations we had in building out a WiFi platform. We now have many types of WiFi drivers - but the API surface is the same. Please just call this "WiFi" (or call it "WLAN" - in China we must call it WLAN, not WiFi)
    • Windows.Win32.Mbn, Windows.Win32.MobileBroadband - 2 comments: these 2 both refer to cellular APIs so we should have one name; the cellular team has been trying to deprecate and move people away from the old COM API and the very old C APIs (I'm guessing that's what each if this are covering). IMHO we would not surface any of these APIs - we are actively moving folks to use the WinRT APIs.

thanks for reading if you made it this far :)

mikebattista commented 3 years ago

Splitting them up by network management vs network client seems reasonable. In any case, I don't think having things like IPHelper as a top level namespace makes sense. All the ones I mentioned should definitely be under one or more networking-related parent namespaces.

You can view the metadata yourself to see what APIs are in each namespace. See the instructions in the README.

In general, I'm not inclined to hide any specific APIs. If there's value in newer versions of APIs, people will migrate to them, otherwise we want as much coverage of what's in the SDK as possible.

keith-horton commented 3 years ago

Agreed: IPHelper should also be under Networking. It's one of the "core" management APIs we have.

If a feature team is wanting to deprecate old C APIs, I would hope we don't continue to give them visibility through this effort. That's only going to make it harder to make a deprecation message of "Please don't use these APIs."

mikebattista commented 3 years ago

I'd rather rely on existing deprecation mechanisms than filter them out completely.

keith-horton commented 3 years ago

For old APIs we don't have great communication mechanisms to warn developers to not use them. Effectively "text" to hint "please don't call this". Why would we continue to surface APIs which we actively do not want anyone to use? Now we give the mixed message of text-hints saying "Please don't call this API" which the latest-and-greatest efforts from our SDK continues to make it an equivalent 1st party API next to APIs we want developers to use.

This is likely going to make our efforts even more difficult to try to move developers away from APIs we don't want anyone calling.

mikebattista commented 3 years ago

What about customers on Windows 7 where WinRT isn't available for example?

keith-horton commented 3 years ago

Hopefully new efforts are not trying to help support OS's which are no longer under support: https://www.microsoft.com/en-US/windows/windows-7-end-of-life-support-information

those old APIs technically still exist for very old code, but they are not updated to support the latest types of networks and we don't want to continue to promote them.

mikebattista commented 3 years ago

These scenarios are still important to customers, and remaining compatible with existing code is also important.

We're striving for full fidelity with the SDK right now. I don't think we should remove things particularly with scenarios like this.

We can continue the discussion on deprecation at https://github.com/microsoft/win32metadata/discussions/403.

kennykerr commented 3 years ago

Thanks for all the feedback! I've updated the table as best I can based on specific feedback. A few things to keep in mind:

mikebattista commented 3 years ago

Some more feedback based on the changes:

kennykerr commented 3 years ago

Fixed most of these. I don't have an opinion on how these APIs should be grouped. Keith raised a lot of (good) questions, but I don't know how to address them. https://github.com/microsoft/win32metadata/issues/388#issuecomment-814950381

Feel free to tweak the table further or suggest additional specific changes.

mikebattista commented 3 years ago

@keith-horton could you take another pass on your feedback, looking through ILSpy to understand what is currently in each namespace? That's the easiest way to understand what's there currently.

mikebattista commented 3 years ago

Some more feedback:

keith-horton commented 3 years ago

@mikebattista , is there a clever way to clone this repo? I closed ILSpy and built it. But I'm continually failing to clone this repo via Visual Studio:

Remote: Compressing objects: 100% (111602/111602), done.
Remote: Total 260274 (delta 213476), reused 152791 (delta 148645), pack-reused 0 From https://github.com/MicrosoftDocs/sdk-api

kennykerr commented 3 years ago

No need to clone this repo just to get the winmd. You can download the latest winmd here.

kennykerr commented 3 years ago

For those who love data, here are the largest namespaces...

Sorted by number of types:

Namespace Types Methods
Windows.Win32.SystemServices 14890 932
Windows.Win32.Security 6548 1169
Windows.Win32.Multimedia 3973 305
Windows.Win32.Shell 3051 699
Windows.Win32.Intl 2900 1225
Windows.Win32.NativeWiFi 2727 61
Windows.Win32.Controls 2694 229
Windows.Win32.MediaFoundation 2620 235
Windows.Win32.Debug 2398 265
Windows.Win32.DirectShow 2207 13

And sorted by methods/functions:

Namespace Types Methods
Windows.Win32.Intl 2900 1225
Windows.Win32.Security 6548 1169
Windows.Win32.SystemServices 14890 932
Windows.Win32.Shell 3051 699
Windows.Win32.AllJoyn 677 532
Windows.Win32.Rpc 877 491
Windows.Win32.WindowsProgramming 2006 482
Windows.Win32.WindowsAndMessaging 2159 473
Windows.Win32.ApplicationInstallationAndServicing 654 453
Windows.Win32.Automation 1440 412
mikebattista commented 3 years ago

I did a pass on consolidating and aligning top-level namespaces with WinRT. The remaining top-level namespaces become:

Still pending feedback from Keith on Networking, and we could probably further break up some of the larger areas like SystemServices into smaller subnamespaces, but this should provide at least a good high level grouping to work with that is more consistent with WinRT.

Before After
ActiveDirectory Networking.ActiveDirectory
AllJoyn Devices.AllJoyn
Antimalware System.Antimalware
ApplicationInstallationAndServicing System.ApplicationInstallationAndServicing
AppxPackaging Storage.Packaging.Appx
Audio Media.Audio.DirectMusic
Automation System.OleAutomation
BackgroundIntelligentTransferService Networking.Bits
Bluetooth Devices.Bluetooth
CloudFilters Storage.CloudFilters
Com System.Com
ComponentServices System.Com
Compression Storage.Compression
Controls UI.Controls
CoreAudio Media.Audio.CoreAudio
DataDeduplication Storage.DataDeduplication
DataExchange System.DataExchange
Debug System.Diagnostics.Debug
DeveloperLicensing System.DeveloperLicensing
DeviceAccess Devices.DeviceAccess
DeviceAndDriverInstallation Devices.DeviceAndDriverInstallation
Dhcp Networking.Dhcp
Direct2D Graphics.Direct2D
Direct3D10 Graphics.Direct3D10
Direct3D11 Graphics.Direct3D11
Direct3D12 Graphics.Direct3D12
Direct3D9 Graphics.Direct3D9
Direct3DHlsl Graphics.Hlsl
DirectComposition Graphics.DirectComposition
DirectDraw Graphics.DirectDraw
DirectML AI.MachineLearning.DirectML
DirectManipulation Graphics.DirectManipulation
DirectShow Graphics.DirectShow
DirectWrite Graphics.DirectWrite
DisplayDevices UI.DisplayDevices
DistributedFileSystem Storage.DistributedFileSystem
Dns Networking.Dns
Dwm Graphics.Dwm
Dxgi Graphics.Dxgi
EnhancedStorage Storage.EnhancedStorage
Etw System.Diagnostics.Etw
ExtensibleAuthenticationProtocol Networking.ExtensibleAuthenticationProtocol
Fax Devices.Fax
FileSeverResourceManager Storage.FileServerResourceManager
FileSystem Storage.FileSystem
GameMode Gaming
GamingDeviceInfo Gaming
Gdi Graphics.Gdi
GroupPolicyManagementConsole System.GroupPolicy
HardwareCounterProfiling System.Performance.HardwareCounterProfiling
HiDpi UI.HiDpi
Hid Devices.HumanInterfaceDevice
HtmlHelp Data.HtmlHelp
Http Networking.Http
Hypervisor System.Hypervisor
IMapi Storage.Imapi
IScsiDisc Storage.IscsiDisc
IndexServer Storage.IndexServer
InkInput UI.InkInput
InstallableFileSystems Storage.InstallableFileSystems
InteractionContext UI.InteractionContext
Intl Globalization
IpHelper Networking.IpHelper
Js System.Js
Kernel System
KeyboardAndMouseInput UI.KeyboardAndMouseInput
Ldap Networking.Ldap
LegacyWindowsEnvironmentFeatures UI.LegacyWindowsEnvironmentFeatures
Location Devices.Geolocation
MachineLearning AI.MachineLearning
Magnification UI.Magnification
Mapi Networking.Mapi
Mbn Networking.Connectivity
MediaFoundation Media.Foundation
MediaTransport Media.Transport
MenusAndResources UI.MenusAndResources
Mib Networking.Mib
MixedReality (move to WinRT)
Mmc System.Mmc
MobileBroadband Networking.Connectivity
MobileDeviceManagementRegistration Management
Monitor Devices.Display
Multicast Networking.Multicast
Multimedia Media.Multimedia
NativeWiFi Devices.WiFi
NetBios Networking.NetBios
NetManagement Networking.Management
NetShell Networking.NetShell
NetworkDiagnosticsFramework Networking.DiagnosticsFramework
NetworkDrivers Networking.Drivers
NetworkListManager Networking.ListManager
NetworkPolicyServer Networking.PolicyServer
OfflineFiles Storage.OfflineFiles
OpenGL Graphics.OpenGL
OperationRecorder Storage.OperationRecorder
OtherDeviceTechnologies Devices.OtherDeviceTechnologies
P2P Networking.P2P
Packaging Storage.Packaging.Opc
ParentalControls System.ParentalControls
PasswordManagement System.PasswordManagement
Perf System.Performance
PerformanceLogAndAlerts System.Performance
PhotoAcquire Media.PictureAcquisition
PointerInput UI.PointerInput
Policy System.GroupPolicy
Power Devices.Power
PrintDocs (move to XPS)
ProcessSnapshotting System.Diagnostics.ProcessSnapshotting
ProcessStatus System
ProjectedFileSystem Storage.ProjectedFileSystem
QualityOfService Networking.QualityOfService
RadialInput UI.RadialInput
Recovery System.Recovery
RemoteAssistance System.RemoteAssistance
RemoteDesktopServices System.RemoteDesktop
RemoteDifferentialCompression Networking.RemoteDifferentialCompression
RestartManager System.RestartManager
RightsManagement Data.RightsManagement
RoutingAndRemoteAccessService System.RoutingAndRemoteAccessService
Rpc System.Rpc
Search System.Search
Security Security
Sensors Devices.Sensors
SerialController Devices.SerialCommunication
SettingsManagementInfrastructure System.SettingsManagementInfrastructure
Shell UI.Shell
Snmp Networking.Snmp
SoftwareDevice Devices.Enumeration.Pnp
Speech Media.Speech
StreamingMedia Media.Streaming
StructuredStorage Storage.StructuredStorage
Sync (move to SystemServices)
SystemEventNotificationService System.EventNotificationService
SystemRestore System.Restore
SystemServices System
TabletPC UI.TabletPC
Tapi Devices.Tapi
TaskScheduler System.TaskScheduler
TextServices UI.TextServices
TilesBadgesNotifications UI.Notifications
TitleCallableUI Gaming
ToolHelp System.Diagnostics.ToolHelp
TouchInput UI.TouchInput
TpmBaseServices System.TpmBaseServices
UIAnimation UI.Animation
UPnp Devices.Enumeration.Pnp
UsbDrivers Devices.Usb
UserAccessLogging System.UserAccessLogging
Vhd Storage.Vhd
WebDav Networking.WebDav
WebSock Networking.WebSocket
Wia Devices.ImageAcquisition
WinInet Networking.WinInet
WinRT System.WinRT
WinSock Networking.WinSock
WindowsAccessibility UI.Accessibility
WindowsAddressBook System.AddressBook
WindowsAndMessaging UI.WindowsAndMessaging
WindowsBiometricFramework Devices.BiometricFramework
WindowsClustering Networking.Clustering
WindowsColorSystem UI.ColorSystem
WindowsConnectNow Networking.ConnectNow
WindowsConnectionManager Networking.Connectivity
WindowsContacts System.Contacts
WindowsDeploymentServices System.DeploymentServices
WindowsDesktopSharing System.DesktopSharing
WindowsErrorReporting System.ErrorReporting
WindowsEventCollector System.EventCollector
WindowsEventLog System.EventLog
WindowsFiltering System.Filtering
WindowsFirewall System.Firewall
WindowsImagingComponent Graphics.Imaging
WindowsInformationProtection Security.EnterpriseData
WindowsMediaDeviceManager Media.DeviceManager
WindowsMediaFormat Media.Format
WindowsMediaLibrarySharingServices Media.LibrarySharingServices
WindowsMediaPlayer Media.MediaPlayer
WindowsNetworkVirtualization Networking.Virtualization
WindowsNetworking Networking
WindowsPortableDevices Devices.PortableDevices
WindowsProgramming System
WindowsPropertiesSystem System.PropertiesSystem
WindowsRemoteManagement System.RemoteManagement
WindowsRibbon UI.Ribbon
WindowsServerBackup System.ServerBackup
WindowsSetupAndMigration System.SetupAndMigration
WindowsStationsAndDesktops System.StationsAndDesktops
WindowsSubsystemForLinux System.SubsystemForLinux
WindowsSync System
WindowsSystemAssessmentTool System.AssessmentTool
WindowsUpdateAgent System.UpdateAgent
WindowsWebServices Networking.WebServices
Wmi System.Wmi
WpfBitmapEffects UI.Wpf
XAudio2 Media.Audio.XAudio2
XInput UI.XInput
XamlDiagnostics UI.XamlDiagnostics
Xblidp Gaming
XmlHttpExtendedRequest Networking
Xps Storage.Xps
mikebattista commented 3 years ago

WinRT splits up Security into Credentials, Cryptography, and Cryptography.Certificates. We could do the same to reduce the size of this large namespace.

We could create System.Registry to hold the Registry APIs from WindowsProgramming.

We could create System.Environment to hold *Environment*, Get/SetComputerName, Get*Directory, GetVersion, etc. from WindowsProgramming.

We could create System.Power to hold Power* from SystemServices.

We could move *Print* out of SystemServices to Devices.Printers.

We could move *Environment* out of SystemServices and into System.Environment.

We could move Threading-related APIs out of SystemServices and into System.Threading.

keith-horton commented 3 years ago

After a full pass through each name, I think I've caught all the networking ones.

Windows.Win32.Http needs to be split into 2:

  1. Windows.Win32.Networking.HttpServer ---> this is for all the functions, structs, and enums from Http.h ---> this is for server-side HTTP calls with http.sys
  2. Windows.Win32.Networking.WinHttp ---> this is for all the functions, structs, and enums from winhttp.h ---> this is for using "WinHttp" APIs - that's a well-known name so we should not abbreviate it to just 'http' as it will get very confusing with the above http.sys APIs

Windows.Win32.IpHelper

Windows.Win32.Mbn

Windows.Win32.Mib

Windows.Win32.NativeWiFi

Windows.Win32.NetworkManagement.NetManagement -- this is just a really bad name, but there's not an obvious better one :( -- apparently our old MSDN docs say "Network Management" -- so I guess we can keep that if we think we would prefer at least parity with MSDN

Windows.Win32.NetShell

Windows.Win32.NetworkDrivers

Windows.Win32.NetworkListManager

Windows.Win32.QualityOfService

Windows.Win32.RoutingAndRemoteAccessService

Windows.Win32.WebSock

Windows.Win32.WindowsConnectionManager -- please put everything from ondemandconnroutehelper.h here

Windows.win32.WindowsFiltering

Windows.Win32.WindowsNetworking

Would recommend the following under Networking: Windows.Win32.Networking.BackgroundIntelligentTransferService Windows.Win32.Networking.HttpServer Windows.Win32.Networking.NetworkListManager Windows.Win32.Networking.WebSocket Windows.Win32.Networking.WindowsWebServices Windows.Win32.Networking.WinHttp Windows.Win32.Networking.WinInet Windows.Win32.Networking.WinSock

Would recommend the following under NetworkManagement: Windows.Win32.NetworkManagement.Dhcp Windows.Win32.NetworkManagement.Dns Windows.Win32.NetworkManagement.IpHelper Windows.Win32.NetworkManagement.Multicast Windows.Win32.NetworkManagement.MobileBroadband Windows.Win32.NetworkManagement.NetBios Windows.Win32.NetworkManagement.NetManagement Windows.Win32.NetworkManagement.NetShell (unless we can delete it - shouldn't be documented) Windows.Win32.NetworkManagement.NetworkDiagnosticsFramework Windows.Win32.NetworkManagement.NetworkPolicyServer Windows.Win32.NetworkManagement.P2P Windows.Win32.NetworkManagement.QoS Windows.Win32.NetworkManagement.RRAS Windows.Win32.NetworkManagement.Snmp Windows.Win32.NetworkManagement.WebDav Windows.Win32.NetworkManagement.WiFi Windows.Win32.NetworkManagement.WindowsConnectionManager Windows.Win32.NetworkManagement.WindowsConnectNow Windows.Win32.NetworkManagement.WindowsFilteringPlatform Windows.Win32.NetworkManagement.WindowsFirewall Windows.Win32.NetworkManagement.WNet Windows.Win32.NetworkManagement.WindowsNetworkVirtualization

mikebattista commented 3 years ago

Thanks Keith!

NetShell appears to be https://docs.microsoft.com/en-us/previous-versions/windows/desktop/netshell/programming-elements-exposed-by-netshell. If it's part of the SDK, and it looks like it is coming from netsh.h in the SDK, and documented, then we should include it.

mikebattista commented 3 years ago

@keith-horton could you build and inspect the winmd from https://github.com/microsoft/win32metadata/tree/namespaces? I believe I addressed most of your feedback except for the below. Just clone and run ./DoAll.ps1 from the root.

Windows.Win32.IpHelper

Sadly we are showing our "versioning" scheme by showing the structures named IP_blah_XP / IP_blah_LH we forked these structures between those old OS releases - but we expect users to only use IP_blah (not with the XP or LH suffixes). I would guess many/most developers aren't even aware of this old naming and would just be very confused. if there's any way to remove that and just have IP_blah, that will greatly help our developer community using these (very complicated) APIs

I just moved the namespace. Didn't change any types like this.

Windows.Win32.NativeWiFi

there's some stuff here from pciprop.h. (like the DevProp_PciExpress* stuff) those that are networking related should go under some generic PCI bus/hardware namespace? Or just Ndis. B

Could you be more prescriptive about what you want here? It's easy to assign everything in a header file to a namespace. If you want to only move a subset, please provide that subset explicitly.

mikebattista commented 3 years ago

@jonwis who can speak to Printing APIs? I'm looking at https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/_print/ and thinking these could all probably go into a namespace like Windows.Win32.Graphics.Printing to align with Windows.Graphics.Printing so we can move things like winspool.h out of the big SystemServices namespace.

Would need additional feedback on subnamespaces if it makes sense to split them up, similar to how Keith evaluated the Networking space.

jonwis commented 3 years ago

Maybe this issue thread should be converted into a pull-request to add/modify some file with the namespace-to-type mappings? It's getting hard to read the comments.

@mziller is the API rep for printing

mikebattista commented 3 years ago

I'm working on namespaces in the namespaces branch and have updated CONTRIBUTOR.md with details on the changes required. If others can file pull requests with the specific changes they want, that would be ideal.

In any case, assigning whole header files to namespaces is the simplest way to model things and maps cleanly to how the tooling works. Once you start splitting up a header file into multiple namespaces, you need to start listing specific APIs and what namespace they should map to. Would prefer to keep that to a minimum where possible, though we understand the Win32 headers aren't always cleanly factored and splitting up a header will be necessary in some cases.

kennykerr commented 3 years ago

You can browse the latest Win32 namespace remappings here:

https://microsoft.github.io/windows-docs-rs/doc/bindings/Windows/Win32/index.html

Good job @mikebattista!

mikebattista commented 3 years ago

Awesome! Looks great and I have a lot more planned.

jonwis commented 3 years ago

https://microsoft.github.io/windows-docs-rs/doc/bindings/Windows/Win32/Storage/FileSystem/fn.ReadFile.html is pretty neat. Are we going to get the SAL-like annotations indicating that nnumberofbytestoread is related to lpbuffer and lpnumberofbytesread? Is there a uniform OVERLAPPED adapter for Rust?

kennykerr commented 3 years ago

Yes, SAL annotations are captured as attributes in metadata. Rust doesn't yet fully support those attributes that relate to arrays. Coming soon.

Low-level OVERLAPPED support is available - here's an example. I expect dedicated crates to wrap these low-level APIs in idiomatic Rust libraries as needed, although Rust's standard library already has good I/O support. This is more interesting as the Rust compiler and standard library should eventually use the Windows crate internally.

kennykerr commented 2 years ago

Closing this issue as the namespaces seem to be settled.