Closed lukebayes closed 3 years ago
I took your code and with some tweeks compiled it and ran it on windows and got the output below. Not sure what that exception is. It's possible this is a problem with Wine. Also I have not implemented nested types like you saw, that could also be the cause. If you want to provide me with a project or just code to reproduce your issue exactly, I could help more.
Loaded
pre enumerator: IMMDeviceEnumerator{ .vtable = VTable{ .base = VTable{ .QueryInterface = fn(*const .win32.win32.system.com.IUnknown,
*const .win32.win32.zig.Guid, **c_void) callconv(.C) i32@7ffb14448470, .AddRef = fn(*const .win32.win32.system.com.IUnknown) callconv(.C) u32@7ffb144481f0, .Release = fn(*const .win32.win32.system.com.IUnknown) callconv(.C) u32@7ffb14432510 }, .EnumAudioEndpoints =
fn(*const .win32.win32.media.audio.core_audio.IMMDeviceEnumerator, .win32.win32.media.audio.core_audio.EDataFlow, u32, **.win32.win32.media.audio.core_audio.IMMDeviceCollection) callconv(.C) i32@7ffb1443d0a0, .GetDefaultAudioEndpoint = fn(*const .win32.win32.media.audio.core_audio.IMMDeviceEnumerator, .win32.win32.media.audio.core_audio.EDataFlow, .win32.win32.media.audio.core_audio.ERole, **.win32.win32.media.audio.core_audio.IMMDevice) callconv(.C) i32@7ffb14449430, .GetDevice = fn(*const .win32.win32.media.audio.core_audio.IMMDeviceEnumerator, [*:0]const u16, **.win32.win32.media.audio.core_audio.IMMDevice) callconv(.C) i32@7ffb1443b780, .RegisterEndpointNotificationCallback = fn(*const .win32.win32.media.audio.core_audio.IMMDeviceEnumerator, *.win32.win32.media.audio.core_audio.IMMNotificationClient) callconv(.C) i32@7ffb14436510, .UnregisterEndpointNotificationCallback = fn(*const .win32.win32.media.audio.core_audio.IMMDeviceEnumerator, *.win32.win32.media.audio.core_audio.IMMNotificationClient) callconv(.C) i32@7ffb144327f0 } }
index: 0
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 15 }
index: 1
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 37 }
index: 2
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 2 }
index: 3
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 6 }
index: 4
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 2 }
index: 5
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 3 }
index: 6
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 100 }
index: 7
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 2 }
index: 8
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 1 }
index: 9
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 24 }
index: 10
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 0 }
index: 11
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 8 }
index: 12
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 12 }
index: 13
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 0 }
index: 14
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 24 }
index: 15
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 27 }
index: 16
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 1 }
index: 17
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 1 }
index: 18
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 2 }
index: 19
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 2 }
index: 20
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 0 }
index: 21
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 2 }
index: 22
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 3 }
index: 23
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 4 }
index: 24
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 5 }
index: 25
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 6 }
index: 26
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 7 }
index: 27
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 8 }
index: 28
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 1 }
index: 29
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 0 }
index: 30
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 0 }
index: 31
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 1 }
index: 32
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 0 }
index: 33
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 2 }
index: 34
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 2 }
index: 35
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 3 }
index: 36
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 0 }
index: 37
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 3 }
index: 38
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 1 }
index: 39
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 2 }
index: 40
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 5 }
index: 41
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 5 }
index: 42
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 9 }
index: 43
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 9 }
index: 44
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 10 }
index: 45
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 10 }
index: 46
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 1 }
index: 47
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 14 }
index: 48
Looping propeties with: PROPERTYKEY{ .fmtid = Guid@d9ecbff430, .pid = 2 }
P.S. if you're code is using a type that requires a nested type, I might take it and include it in the project for a regression test and then I can implemented nested types with that test.
Ok I got this to compile and reproduced the error with Wine. You have indeed ran into an unimplemented feature. I'll see if I can get this implemented.
Ok I've implemented nested types. You can see the diff here: https://github.com/marlersoft/zigwin32/commit/8d98f745a274ddeb49f0baac13966fe402a21b3d
I've also added an example based on your code here: https://github.com/marlersoft/zigwin32gen/blob/main/examples/wasapi.zig
Update your zigwin32 repo and let me know if it's working now.
I just verified the fix, and it's working great!
Awesome work!
FWIW, I just gave you a shout out on the twitterererers...
https://twitter.com/lukebayes/status/1397190953836982272
:-)
Thanks for the great library!
Here's a rough version of the code that I'm trying to run.
I'm very new to Zig and Win32 COM APIs, and there are almost certainly problems in here, so any tips are appreciated.
Here's the stack trace that I get when running this in Wine:
I did notice this in
structured_storage.zig
:Any help is appreciated, and nice work on this library!