February 17, 2021
On Tuesday, 16 February 2021 at 08:45:19 UTC, Rumbu wrote:
> The D Windows SDK projection reached first version. Generated bindings were compiled succesfully.
>
> https://github.com/rumbu13/windows-d
>
> Destroy!

Thanks for this, looks great.
Could the generated code be annotated with nothrow @nogc too?

Tom
February 17, 2021
On Wednesday, 17 February 2021 at 20:53:49 UTC, tchaloupka wrote:
> Thanks for this, looks great.
> Could the generated code be annotated with nothrow @nogc too?

+1

This is actually missing in many core.sys.windows modules.
February 17, 2021
On 2/17/2021 2:09 PM, Dennis wrote:
> On Wednesday, 17 February 2021 at 20:53:49 UTC, tchaloupka wrote:
>> Thanks for this, looks great.
>> Could the generated code be annotated with nothrow @nogc too?
> 
> +1
> 
> This is actually missing in many core.sys.windows modules.

Please file bugzilla issues for them!
February 18, 2021
On Wednesday, 17 February 2021 at 20:53:49 UTC, tchaloupka wrote:
> On Tuesday, 16 February 2021 at 08:45:19 UTC, Rumbu wrote:
>> The D Windows SDK projection reached first version. Generated bindings were compiled succesfully.
>>
>> https://github.com/rumbu13/windows-d
>>
>> Destroy!
>
> Thanks for this, looks great.
> Could the generated code be annotated with nothrow @nogc too?
>
> Tom

I don't know what to say about nothrow. There are WinAPI functions generating exceptions. For example the code below trying to allocate size_t.max bytes, even we reserved 10 only:

auto h = HeapCreate(4, 10, 10);
auto p = HeapAlloc(h, 4, size_t.max);

Now, the D runtime catches internally any Windows exception and throws a generic Win32 Error without any other information, and of course, this will qualify HeapAlloc as a nothrow function.

In reality, this should not be just an uncatchable Error, but a full Exception object having the associated error code (0xC0000017), the associated default message ("Not Enough Quota") and the value of the offending parameter (0xFFFFFFFF). All this information is available in SEH records but it is ignored by D runtime.
February 18, 2021
On Thursday, 18 February 2021 at 00:46:26 UTC, Walter Bright wrote:
> Please file bugzilla issues for them!

I'm not going to file issues for each individual module, since there are about 100 of them. There already is a general issue about Windows headers: https://issues.dlang.org/show_bug.cgi?id=16267

I actually started working on adding the missing annotations to druntime half a year ago, but abandoned it because it took more time than expected. The tricky part is that modules can contain callback definitions, and adding @nogc nothrow to those is a breaking change. This is where Argument dependent attributes (https://github.com/dlang/DIPs/pull/198) could be useful.

I might pick it up again, but if these auto-generated bindings can be incorporated into core.sys.windows that wouldn't be necessary anymore.
February 18, 2021
On 2/17/21 2:01 PM, Rumbu wrote:

> OK, you convinced me :)
> 
> Enjoy: https://github.com/rumbu13/windows-d#features
> 
> 

Nice!

-Steve
February 18, 2021
On Wednesday, 17 February 2021 at 19:01:31 UTC, Rumbu wrote:
> On Wednesday, 17 February 2021 at 14:53:11 UTC, Steven Schveighoffer wrote:
>> On 2/16/21 3:45 PM, Rumbu wrote:
>>> [...]
>>
>> Note that in-line docs help with more than just putting docs on dlang.org. It helps with IDEs that use the docs to tell you what your function you are typing is doing, and also if you are reading the source code.
>>
>>> [...]
>>
>> What about just having the short summary, and then links to the MS docs?
>>
>> -Steve
>
> OK, you convinced me :)
>
> Enjoy: https://github.com/rumbu13/windows-d#features

🎂🎉
1 2
Next ›   Last »