This repository was archived by the owner on Mar 30, 2026. It is now read-only.
fix ConnectedPrinters c implementation#109
Open
SemsYapar wants to merge 1 commit intoUnprotect-Project:mainfrom
Open
fix ConnectedPrinters c implementation#109SemsYapar wants to merge 1 commit intoUnprotect-Project:mainfrom
SemsYapar wants to merge 1 commit intoUnprotect-Project:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connected printers
Authorship information
Technique Information
Fix
Firstly here API info
this line broke because EnumPrinters API return error in this scenario
pcbNeeded does not mean numPrinters, the argument that gives the numPrinters information is pcReturned, but current implementation has given it to the API as NULL, so the API cannot work properly and return 0x57 (ERROR_INVALID_PARAMETER)
this part does not effect progress but its not true for document because enumprinter_msdn
says pcbNeeded = A pointer to a value that receives the number of bytes copied if the function succeeds or the number of bytes required if cbBuf is too small.
so all we need use pcbNeeded size to malloc