-
Notifications
You must be signed in to change notification settings - Fork 329
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
It is impossible to use resumeHandle in NetWkstaUserEnum #4955
Comments
This appears to have been posted in the wrong Repo. Closing with no action. |
@RDMacLachlan so what is the correct place to report windows api bugs? |
Less than ideal response from someone "working towards improving the Windows application experience". @jonwis is this something you're tracking in ADO/VSO and/or can help route? |
@OrbintSoft I would recommend starting with posting the feedback on the learn.microsoft.com page you've linked above for the API. Steps:
|
@RDMacLachlan this issue should be opened as it is not resolved at all and be assigned to someone who will actively work in this issue. |
Describe the bug
NetWkstaUserEnum appears to retrieve users in reverse order and makes a misuse resumeHandle , this makes impossible to use the function with a specified buffer size.
If you execute the code from Microsoft documentation: https://learn.microsoft.com/en-us/windows/win32/api/lmwksta/nf-lmwksta-netwkstauserenum
and you setup a buffer able to hold only a partial list of users, the code will be blocked in the loop forever returning always the same chunk of users.
You can refer at this stackoverflow answer: https://stackoverflow.com/a/79271924/5081328 where [RbMm] did a detailed analysis of the bug.
Steps to reproduce the bug
Take a windows machine with a considerable amount of currently simultaneously logged users.
execute this code as taken from Microsoft documentation:
Set dwPrefMaxLen to a size able hold at least one user, execute the code.
Expected behavior
It should fetch all users that can be hold in the buffer specified by dwPrefMaxLen , the call should give a chunk of users and return ERROR_MORE_DATA-
At the next iteration NetWkstaUserEnum should retrieve the next chunk of users.
Screenshots
No response
NuGet package version
None
Packaging type
No response
Windows version
Windows 11 version 22H2 (22621, 2022 Update), Windows 10 version 22H2 (19045, 2022 Update), Windows 11 version 21H2 (22000), Windows 10 version 21H2 (19044, November 2021 Update), Windows 10 version 21H1 (19043, May 2021 Update), Windows 10 version 20H2 (19042, October 2020 Update), Windows 10 version 2004 (19041, May 2020 Update), Windows 10 version 1909 (18363, November 2019 Update), Windows 10 version 1903 (18362, May 2019 Update), Windows 10 version 1809 (17763, October 2018 Update)
IDE
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: