Thread overview
Windows dnsapi
November 01

Hello,

I'm wondering if anyone here used the Windows dnsapi.

Currently I'm just using the mingw dnsapi.lib and manually typing my exports, but it would be nice if a module came with D.

I was thinking about adding one, but I don't know if there are already tools available to generate them from header files (if they can be found).

The other modules live in druntime (import) core.sys.windows.

dnsapi is almost entierly undocumented for some reason (pinvoke also only has 4 of them), so I currently I have just dumped the exports via dumpbin.

I tested some (two) of the 289 functions and they work as expected which is nice.

Who has done things like this in the past and know if there are tools available for D to aid in this process?

Thanks

November 01

On Wednesday, 1 November 2023 at 14:34:22 UTC, Imperatorn wrote:

>

Hello,

I'm wondering if anyone here used the Windows dnsapi.

Currently I'm just using the mingw dnsapi.lib and manually typing my exports, but it would be nice if a module came with D.

I was thinking about adding one, but I don't know if there are already tools available to generate them from header files (if they can be found).

The other modules live in druntime (import) core.sys.windows.

dnsapi is almost entierly undocumented for some reason (pinvoke also only has 4 of them), so I currently I have just dumped the exports via dumpbin.

I tested some (two) of the 289 functions and they work as expected which is nice.

Who has done things like this in the past and know if there are tools available for D to aid in this process?

Thanks

I decompiled the entire dnsapi and it was 114_075 lines. I took only the function declarations and translated them to D. It kinda works, but I don't know where to put it.
I guess if something is "undocumented it can't be used", or what's the view on such things?

November 01

On Wednesday, 1 November 2023 at 15:39:20 UTC, Imperatorn wrote:

>

I decompiled the entire dnsapi and it was 114_075 lines. I took only the function declarations and translated them to D. It kinda works, but I don't know where to put it.
I guess if something is "undocumented it can't be used", or what's the view on such things?

Microsoft's "compatibility cookbook" says "don't do it".

I guess you could put the bindings up on dub, with a big USE AT YOUR OWN RISK warning.

November 01

On Wednesday, 1 November 2023 at 17:34:31 UTC, Paul Backus wrote:

>

On Wednesday, 1 November 2023 at 15:39:20 UTC, Imperatorn wrote:

>

I decompiled the entire dnsapi and it was 114_075 lines. I took only the function declarations and translated them to D. It kinda works, but I don't know where to put it.
I guess if something is "undocumented it can't be used", or what's the view on such things?

Microsoft's "compatibility cookbook" says "don't do it".

I guess you could put the bindings up on dub, with a big USE AT YOUR OWN RISK warning.

Yeah, for now I just put them here:
https://github.com/Imperatorn/undocumented