Skip to content

Commit b8dda2d

Browse files
authored
Merge pull request #16594 from squeek502/windows-sdk-com
windows_sdk.zig: Reinstate COM ISetupEnumInstances logic
2 parents 796927b + 41aaf1e commit b8dda2d

File tree

3 files changed

+345
-25
lines changed

3 files changed

+345
-25
lines changed

lib/std/os/windows.zig

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,6 +2496,8 @@ pub const LPCWSTR = [*:0]const WCHAR;
24962496
pub const PVOID = *anyopaque;
24972497
pub const PWSTR = [*:0]WCHAR;
24982498
pub const PCWSTR = [*:0]const WCHAR;
2499+
/// Allocated by SysAllocString, freed by SysFreeString
2500+
pub const BSTR = [*:0]WCHAR;
24992501
pub const SIZE_T = usize;
25002502
pub const UINT = c_uint;
25012503
pub const ULONG_PTR = usize;
@@ -3253,6 +3255,7 @@ pub const KF_FLAG_SIMPLE_IDLIST = 256;
32533255
pub const KF_FLAG_ALIAS_ONLY = -2147483648;
32543256

32553257
pub const S_OK = 0;
3258+
pub const S_FALSE = 0x00000001;
32563259
pub const E_NOTIMPL = @as(c_long, @bitCast(@as(c_ulong, 0x80004001)));
32573260
pub const E_NOINTERFACE = @as(c_long, @bitCast(@as(c_ulong, 0x80004002)));
32583261
pub const E_POINTER = @as(c_long, @bitCast(@as(c_ulong, 0x80004003)));
@@ -3563,15 +3566,11 @@ pub const RTL_RUN_ONCE = extern struct {
35633566

35643567
pub const RTL_RUN_ONCE_INIT = RTL_RUN_ONCE{ .Ptr = null };
35653568

3566-
pub const COINIT_APARTMENTTHREADED = COINIT.COINIT_APARTMENTTHREADED;
3567-
pub const COINIT_MULTITHREADED = COINIT.COINIT_MULTITHREADED;
3568-
pub const COINIT_DISABLE_OLE1DDE = COINIT.COINIT_DISABLE_OLE1DDE;
3569-
pub const COINIT_SPEED_OVER_MEMORY = COINIT.COINIT_SPEED_OVER_MEMORY;
3570-
pub const COINIT = enum(c_int) {
3571-
COINIT_APARTMENTTHREADED = 2,
3572-
COINIT_MULTITHREADED = 0,
3573-
COINIT_DISABLE_OLE1DDE = 4,
3574-
COINIT_SPEED_OVER_MEMORY = 8,
3569+
pub const COINIT = struct {
3570+
pub const APARTMENTTHREADED = 2;
3571+
pub const MULTITHREADED = 0;
3572+
pub const DISABLE_OLE1DDE = 4;
3573+
pub const SPEED_OVER_MEMORY = 8;
35753574
};
35763575

35773576
pub const MEMORY_BASIC_INFORMATION = extern struct {

lib/std/os/windows/ole32.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ const HRESULT = windows.HRESULT;
88
pub extern "ole32" fn CoTaskMemFree(pv: LPVOID) callconv(WINAPI) void;
99
pub extern "ole32" fn CoUninitialize() callconv(WINAPI) void;
1010
pub extern "ole32" fn CoGetCurrentProcess() callconv(WINAPI) DWORD;
11+
pub extern "ole32" fn CoInitialize(pvReserved: ?LPVOID) callconv(WINAPI) HRESULT;
1112
pub extern "ole32" fn CoInitializeEx(pvReserved: ?LPVOID, dwCoInit: DWORD) callconv(WINAPI) HRESULT;

0 commit comments

Comments
 (0)