You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, I don't know if I'm too new to rust and Windows apis or if it actually doesn't explain it. Apparently co-pilot is making sense of it and so far I think it's working but I basically just had to give it the VSS code example and just hope it would recognize the function names.
Maybe that's the entire point. But it would be nice if there would be links to the standard Microsoft documentation for whatever it is generating.
I really can't find any documentation for the filter argument. Maybe I just didn't look hard enough.
I would say the docs are both incomplete and slightly misleading. In looking at this myself, I made an assumption which GPT-5.4 also made, twice. It was that the list of methods must be prefixed with some kind of windows prefixing, as shown. This however, did not actually work, and I don't know enough about windows to know if the list is wrong. What actually works is just removing everything before the :: from all of these and just specifying the function name itself.
What worked much better was pasting this example file into the build.rs and then telling GPT-5.4 to work from there. Then it was fairly obvious what needed to happen. It first tried the namespaced list above, as specified in the docs, which didn't work, so it removed the prefix and just went with the sample. Honestly, after reading the docs, this was my initial assumption as well, which is why I used GPT because I had no idea where to find the windows namespace, but it clearly wouldn't have worked anyway.
Since builder is referred to as a CLI-like reference, I think it would be useful to actually include the CLI-like help reference that should theoretically print if you called builder.help(). This means, at minimum, a list of each function call (at least the ones that are considered CLI-like arguments) with their doc comments, perhaps also specifying that .write() comes last. I think this should be added to windows-bindgen.md because otherwise it isn't clear at all how builder or bindgen are actually supposed to be invoked.
The filter reference itself seems to be misleading GPT, and the entire understanding for how to use the builder required GPT to read the bindgen crate source code to determine the API shape, which seems a bit incomplete.
As per #4925 (comment) :
The README section shown in Rafael Rivera (@riverar)'s screenshot is outdated. Namespaces have been removed from the Win32 bindings, and the only way to use them via windows-bindgen now is to specify every single required symbol individually.
Judging by the subsequent comment, this seems to have been an intentional design decision, albeit one that has me stumped. It makes windows-bindgen practically unusable for anything beyond small scribbles, as maintaining a list of hundreds of symbols in build.rs gets infeasible pretty quickly. It is also inconsistent with the feature flags of the windows / windows-sys crates. Can we get some clarification on the rationale behind this?
The README section shown in Rafael Rivera (@riverar)'s screenshot is outdated. Namespaces have been removed from the Win32 bindings, and the only way to use them via windows-bindgen now is to specify every single required symbol individually.
Just to be clear, the screenshot is still current to the page at the moment, though the page the screenshot was taken of may be outdated.
Activity
riverar commentedon Sep 22, 2026
Hey Arlen Beiler (@Arlen22), have you checked out the getting started doc linked in the README? https://github.com/microsoft/windows-rs/blob/master/docs/crates/windows-bindgen.md
Arlen22 commentedon Sep 22, 2026
Yes, I don't know if I'm too new to rust and Windows apis or if it actually doesn't explain it. Apparently co-pilot is making sense of it and so far I think it's working but I basically just had to give it the VSS code example and just hope it would recognize the function names.
Maybe that's the entire point. But it would be nice if there would be links to the standard Microsoft documentation for whatever it is generating.
I really can't find any documentation for the filter argument. Maybe I just didn't look hard enough.
riverar commentedon Sep 22, 2026
Check out this section and let us know if it still doesn't make sense.
Arlen22 commentedon Sep 28, 2026
I would say the docs are both incomplete and slightly misleading. In looking at this myself, I made an assumption which GPT-5.4 also made, twice. It was that the list of methods must be prefixed with some kind of windows prefixing, as shown. This however, did not actually work, and I don't know enough about windows to know if the list is wrong. What actually works is just removing everything before the
::from all of these and just specifying the function name itself.What worked much better was pasting this example file into the build.rs and then telling GPT-5.4 to work from there. Then it was fairly obvious what needed to happen. It first tried the namespaced list above, as specified in the docs, which didn't work, so it removed the prefix and just went with the sample. Honestly, after reading the docs, this was my initial assumption as well, which is why I used GPT because I had no idea where to find the windows namespace, but it clearly wouldn't have worked anyway.
Since builder is referred to as a CLI-like reference, I think it would be useful to actually include the CLI-like help reference that should theoretically print if you called
builder.help(). This means, at minimum, a list of each function call (at least the ones that are considered CLI-like arguments) with their doc comments, perhaps also specifying that.write()comes last. I think this should be added towindows-bindgen.mdbecause otherwise it isn't clear at all how builder or bindgen are actually supposed to be invoked.The filter reference itself seems to be misleading GPT, and the entire understanding for how to use the builder required GPT to read the bindgen crate source code to determine the API shape, which seems a bit incomplete.
LastExceed commentedon Sep 30, 2026
As per #4925 (comment) :
The README section shown in Rafael Rivera (@riverar)'s screenshot is outdated. Namespaces have been removed from the Win32 bindings, and the only way to use them via
windows-bindgennow is to specify every single required symbol individually.Judging by the subsequent comment, this seems to have been an intentional design decision, albeit one that has me stumped. It makes
windows-bindgenpractically unusable for anything beyond small scribbles, as maintaining a list of hundreds of symbols inbuild.rsgets infeasible pretty quickly. It is also inconsistent with the feature flags of thewindows/windows-syscrates. Can we get some clarification on the rationale behind this?[-]Windows Bindgen docs missing filter reference[/-][+]`windows-bindgen`: Document filter syntax and usage[/+][-]`windows-bindgen`: Document filter syntax and usage[/-][+]`windows-bindgen` document filter syntax and usage[/+]Arlen22 commentedon Oct 1, 2026
Just to be clear, the screenshot is still current to the page at the moment, though the page the screenshot was taken of may be outdated.
[-]`windows-bindgen` document filter syntax and usage[/-][+]document filter syntax and usage[/+]