Skip to content
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

Feature Request: Server Core friendly modifications #23

Open
someone1 opened this issue Sep 15, 2016 · 4 comments
Open

Feature Request: Server Core friendly modifications #23

someone1 opened this issue Sep 15, 2016 · 4 comments

Comments

@someone1
Copy link

Is it possible to disable parts of the wrapper for components that don't ship with Server Core installations of Windows, such as the opengl32 component?

See influxdata/telegraf#1763 for a reason why this could be useful.

@someone1
Copy link
Author

someone1 commented Sep 15, 2016

Some guidance on how to detect if it is a server core installation:

https://msdn.microsoft.com/en-us/library/ee391629(v=vs.85).aspx
https://blogs.technet.microsoft.com/server_core/2013/09/30/detecting-server-core-in-code/

Perhaps this change (although a breaking one) could be implemented rather than detecting supported libraries depending on the version of Windows:

Proposal

Instead of loading all libraries on import (via init()), the user must call on which APIs they want to load themselves. This would reduce the load time impact from the library and only keep active in memory parts of the Windows API the user wants to use.

The change would be simple: rename all the init() functions to Load<LibName>()

If the current branch is tagged as "v1" then this breaking change could be made "v2" and users can keep using this API by switching their imports to "gopkg.in/lxn/win.v1". Or a branch named "v2" can be introduced with this change so anyone that wants the "lazy load" feature can use the import path "gopkg.in/lxn/win.v2" with the only caveat being this wouldn't be the default interface going forward and any updates to the master branch would have to be pulled into the v2 branch.

@JeffAshton
Copy link

Feels like this library should just be broken apart instead of getting too fancy with detecting the core version.

@JeffAshton
Copy link

JeffAshton commented Nov 8, 2016

Hey guys, I pulled the Performance Data Helper wrapper into it's own library. @lxn would you be interested in taking ownership of this fork? Really it's your library, but just the PDH helpers. Sounds like you've already forked once from walk. :)

https://github.com/JeffAshton/win_pdh

@thecloudtaylor
Copy link

With Windows Server version 1709 Server Core is the only host now, so this will be important (if it's not already addressed?).

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

No branches or pull requests

3 participants