mssf-com 0.10.0

Rust for Azure Service Fabric. The COM base layer.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
#[cfg(feature = "ServiceFabric_FabricTypes")]
#[inline]
pub unsafe fn FabricDecryptText<P0>(
    encryptedtext: P0,
    certstorelocation: super::FabricTypes::FABRIC_X509_STORE_LOCATION,
) -> windows_core::Result<IFabricStringResult>
where
    P0: windows_core::Param<windows_core::PCWSTR>,
{
    windows_core::link!("" "C" fn FabricDecryptText(encryptedtext : windows_core::PCWSTR, certstorelocation : super::FabricTypes::FABRIC_X509_STORE_LOCATION, decryptedtext : *mut *mut core::ffi::c_void) -> windows_core::HRESULT);
    unsafe {
        let mut result__ = core::mem::zeroed();
        FabricDecryptText(
            encryptedtext.param().abi(),
            certstorelocation,
            &mut result__,
        )
        .and_then(|| windows_core::imp::Type::from_abi(result__))
    }
}
#[inline]
pub unsafe fn FabricDecryptValue<P0>(
    encryptedvalue: P0,
) -> windows_core::Result<IFabricStringResult>
where
    P0: windows_core::Param<windows_core::PCWSTR>,
{
    windows_core::link!("" "C" fn FabricDecryptValue(encryptedvalue : windows_core::PCWSTR, decryptedvalue : *mut *mut core::ffi::c_void) -> windows_core::HRESULT);
    unsafe {
        let mut result__ = core::mem::zeroed();
        FabricDecryptValue(encryptedvalue.param().abi(), &mut result__)
            .and_then(|| windows_core::imp::Type::from_abi(result__))
    }
}
#[cfg(feature = "ServiceFabric_FabricTypes")]
#[inline]
pub unsafe fn FabricEncryptText<P0, P1, P2, P4>(
    text: P0,
    certthumbprint: P1,
    certstorename: P2,
    certstorelocation: super::FabricTypes::FABRIC_X509_STORE_LOCATION,
    algorithmoid: P4,
) -> windows_core::Result<IFabricStringResult>
where
    P0: windows_core::Param<windows_core::PCWSTR>,
    P1: windows_core::Param<windows_core::PCWSTR>,
    P2: windows_core::Param<windows_core::PCWSTR>,
    P4: windows_core::Param<windows_core::PCWSTR>,
{
    windows_core::link!("" "C" fn FabricEncryptText(text : windows_core::PCWSTR, certthumbprint : windows_core::PCWSTR, certstorename : windows_core::PCWSTR, certstorelocation : super::FabricTypes::FABRIC_X509_STORE_LOCATION, algorithmoid : windows_core::PCWSTR, encryptedvalue : *mut *mut core::ffi::c_void) -> windows_core::HRESULT);
    unsafe {
        let mut result__ = core::mem::zeroed();
        FabricEncryptText(
            text.param().abi(),
            certthumbprint.param().abi(),
            certstorename.param().abi(),
            certstorelocation,
            algorithmoid.param().abi(),
            &mut result__,
        )
        .and_then(|| windows_core::imp::Type::from_abi(result__))
    }
}
#[inline]
pub unsafe fn FabricEncryptText2<P0, P1, P2>(
    text: P0,
    certfilepath: P1,
    algorithmoid: P2,
) -> windows_core::Result<IFabricStringResult>
where
    P0: windows_core::Param<windows_core::PCWSTR>,
    P1: windows_core::Param<windows_core::PCWSTR>,
    P2: windows_core::Param<windows_core::PCWSTR>,
{
    windows_core::link!("" "C" fn FabricEncryptText2(text : windows_core::PCWSTR, certfilepath : windows_core::PCWSTR, algorithmoid : windows_core::PCWSTR, encryptedvalue : *mut *mut core::ffi::c_void) -> windows_core::HRESULT);
    unsafe {
        let mut result__ = core::mem::zeroed();
        FabricEncryptText2(
            text.param().abi(),
            certfilepath.param().abi(),
            algorithmoid.param().abi(),
            &mut result__,
        )
        .and_then(|| windows_core::imp::Type::from_abi(result__))
    }
}
#[inline]
pub unsafe fn FabricEncryptValue<P0, P1, P2>(
    certthumbprint: P0,
    certstorename: P1,
    text: P2,
) -> windows_core::Result<IFabricStringResult>
where
    P0: windows_core::Param<windows_core::PCWSTR>,
    P1: windows_core::Param<windows_core::PCWSTR>,
    P2: windows_core::Param<windows_core::PCWSTR>,
{
    windows_core::link!("" "C" fn FabricEncryptValue(certthumbprint : windows_core::PCWSTR, certstorename : windows_core::PCWSTR, text : windows_core::PCWSTR, encryptedvalue : *mut *mut core::ffi::c_void) -> windows_core::HRESULT);
    unsafe {
        let mut result__ = core::mem::zeroed();
        FabricEncryptValue(
            certthumbprint.param().abi(),
            certstorename.param().abi(),
            text.param().abi(),
            &mut result__,
        )
        .and_then(|| windows_core::imp::Type::from_abi(result__))
    }
}
#[inline]
pub unsafe fn FabricGetLastErrorMessage() -> windows_core::Result<IFabricStringResult> {
    windows_core::link!("" "C" fn FabricGetLastErrorMessage(message : *mut *mut core::ffi::c_void) -> windows_core::HRESULT);
    unsafe {
        let mut result__ = core::mem::zeroed();
        FabricGetLastErrorMessage(&mut result__)
            .and_then(|| windows_core::imp::Type::from_abi(result__))
    }
}
windows_core::imp::define_interface!(
    IFabricAsyncOperationCallback,
    IFabricAsyncOperationCallback_Vtbl,
    0x86f08d7e_14dd_4575_8489_b1d5d679029c
);
windows_core::imp::interface_hierarchy!(IFabricAsyncOperationCallback, windows_core::IUnknown);
impl IFabricAsyncOperationCallback {
    pub unsafe fn Invoke<P0>(&self, context: P0)
    where
        P0: windows_core::Param<IFabricAsyncOperationContext>,
    {
        unsafe {
            (windows_core::Interface::vtable(self).Invoke)(
                windows_core::Interface::as_raw(self),
                context.param().abi(),
            );
        }
    }
}
#[repr(C)]
#[doc(hidden)]
pub struct IFabricAsyncOperationCallback_Vtbl {
    pub base__: windows_core::IUnknown_Vtbl,
    pub Invoke: unsafe extern "system" fn(*mut core::ffi::c_void, *mut core::ffi::c_void),
}
unsafe impl Send for IFabricAsyncOperationCallback {}
unsafe impl Sync for IFabricAsyncOperationCallback {}
pub trait IFabricAsyncOperationCallback_Impl: windows_core::IUnknownImpl {
    fn Invoke(&self, context: windows_core::Ref<IFabricAsyncOperationContext>);
}
impl IFabricAsyncOperationCallback_Vtbl {
    pub const fn new<Identity: IFabricAsyncOperationCallback_Impl, const OFFSET: isize>() -> Self {
        unsafe extern "system" fn Invoke<
            Identity: IFabricAsyncOperationCallback_Impl,
            const OFFSET: isize,
        >(
            this: *mut core::ffi::c_void,
            context: *mut core::ffi::c_void,
        ) {
            unsafe {
                let this: &Identity =
                    &*((this as *const *const ()).offset(OFFSET) as *const Identity);
                IFabricAsyncOperationCallback_Impl::Invoke(
                    this,
                    core::mem::transmute_copy(&context),
                );
            }
        }
        Self {
            base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
            Invoke: Invoke::<Identity, OFFSET>,
        }
    }
    pub fn matches(iid: &windows_core::GUID) -> bool {
        iid == &<IFabricAsyncOperationCallback as windows_core::Interface>::IID
    }
}
impl windows_core::RuntimeName for IFabricAsyncOperationCallback {}
windows_core::imp::define_interface!(
    IFabricAsyncOperationContext,
    IFabricAsyncOperationContext_Vtbl,
    0x841720bf_c9e8_4e6f_9c3f_6b7f4ac73bcd
);
windows_core::imp::interface_hierarchy!(IFabricAsyncOperationContext, windows_core::IUnknown);
impl IFabricAsyncOperationContext {
    pub unsafe fn IsCompleted(&self) -> bool {
        unsafe {
            (windows_core::Interface::vtable(self).IsCompleted)(windows_core::Interface::as_raw(
                self,
            ))
        }
    }
    pub unsafe fn CompletedSynchronously(&self) -> bool {
        unsafe {
            (windows_core::Interface::vtable(self).CompletedSynchronously)(
                windows_core::Interface::as_raw(self),
            )
        }
    }
    pub unsafe fn get_Callback(&self) -> windows_core::Result<IFabricAsyncOperationCallback> {
        unsafe {
            let mut result__ = core::mem::zeroed();
            (windows_core::Interface::vtable(self).get_Callback)(
                windows_core::Interface::as_raw(self),
                &mut result__,
            )
            .and_then(|| windows_core::imp::Type::from_abi(result__))
        }
    }
    pub unsafe fn Cancel(&self) -> windows_core::HRESULT {
        unsafe {
            (windows_core::Interface::vtable(self).Cancel)(windows_core::Interface::as_raw(self))
        }
    }
}
#[repr(C)]
#[doc(hidden)]
pub struct IFabricAsyncOperationContext_Vtbl {
    pub base__: windows_core::IUnknown_Vtbl,
    pub IsCompleted: unsafe extern "system" fn(*mut core::ffi::c_void) -> bool,
    pub CompletedSynchronously: unsafe extern "system" fn(*mut core::ffi::c_void) -> bool,
    pub get_Callback: unsafe extern "system" fn(
        *mut core::ffi::c_void,
        *mut *mut core::ffi::c_void,
    ) -> windows_core::HRESULT,
    pub Cancel: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
}
unsafe impl Send for IFabricAsyncOperationContext {}
unsafe impl Sync for IFabricAsyncOperationContext {}
pub trait IFabricAsyncOperationContext_Impl: windows_core::IUnknownImpl {
    fn IsCompleted(&self) -> bool;
    fn CompletedSynchronously(&self) -> bool;
    fn get_Callback(&self) -> windows_core::Result<IFabricAsyncOperationCallback>;
    fn Cancel(&self) -> windows_core::Result<()>;
}
impl IFabricAsyncOperationContext_Vtbl {
    pub const fn new<Identity: IFabricAsyncOperationContext_Impl, const OFFSET: isize>() -> Self {
        unsafe extern "system" fn IsCompleted<
            Identity: IFabricAsyncOperationContext_Impl,
            const OFFSET: isize,
        >(
            this: *mut core::ffi::c_void,
        ) -> bool {
            unsafe {
                let this: &Identity =
                    &*((this as *const *const ()).offset(OFFSET) as *const Identity);
                IFabricAsyncOperationContext_Impl::IsCompleted(this)
            }
        }
        unsafe extern "system" fn CompletedSynchronously<
            Identity: IFabricAsyncOperationContext_Impl,
            const OFFSET: isize,
        >(
            this: *mut core::ffi::c_void,
        ) -> bool {
            unsafe {
                let this: &Identity =
                    &*((this as *const *const ()).offset(OFFSET) as *const Identity);
                IFabricAsyncOperationContext_Impl::CompletedSynchronously(this)
            }
        }
        unsafe extern "system" fn get_Callback<
            Identity: IFabricAsyncOperationContext_Impl,
            const OFFSET: isize,
        >(
            this: *mut core::ffi::c_void,
            callback: *mut *mut core::ffi::c_void,
        ) -> windows_core::HRESULT {
            unsafe {
                let this: &Identity =
                    &*((this as *const *const ()).offset(OFFSET) as *const Identity);
                match IFabricAsyncOperationContext_Impl::get_Callback(this) {
                    Ok(ok__) => {
                        callback.write(core::mem::transmute(ok__));
                        windows_core::HRESULT(0)
                    }
                    Err(err) => err.into(),
                }
            }
        }
        unsafe extern "system" fn Cancel<
            Identity: IFabricAsyncOperationContext_Impl,
            const OFFSET: isize,
        >(
            this: *mut core::ffi::c_void,
        ) -> windows_core::HRESULT {
            unsafe {
                let this: &Identity =
                    &*((this as *const *const ()).offset(OFFSET) as *const Identity);
                IFabricAsyncOperationContext_Impl::Cancel(this).into()
            }
        }
        Self {
            base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
            IsCompleted: IsCompleted::<Identity, OFFSET>,
            CompletedSynchronously: CompletedSynchronously::<Identity, OFFSET>,
            get_Callback: get_Callback::<Identity, OFFSET>,
            Cancel: Cancel::<Identity, OFFSET>,
        }
    }
    pub fn matches(iid: &windows_core::GUID) -> bool {
        iid == &<IFabricAsyncOperationContext as windows_core::Interface>::IID
    }
}
impl windows_core::RuntimeName for IFabricAsyncOperationContext {}
windows_core::imp::define_interface!(
    IFabricGetReplicatorStatusResult,
    IFabricGetReplicatorStatusResult_Vtbl,
    0x30e10c61_a710_4f99_a623_bb1403265186
);
windows_core::imp::interface_hierarchy!(IFabricGetReplicatorStatusResult, windows_core::IUnknown);
impl IFabricGetReplicatorStatusResult {
    #[cfg(feature = "ServiceFabric_FabricTypes")]
    pub unsafe fn get_ReplicatorStatus(
        &self,
    ) -> *const super::FabricTypes::FABRIC_REPLICATOR_STATUS_QUERY_RESULT {
        unsafe {
            (windows_core::Interface::vtable(self).get_ReplicatorStatus)(
                windows_core::Interface::as_raw(self),
            )
        }
    }
}
#[repr(C)]
#[doc(hidden)]
pub struct IFabricGetReplicatorStatusResult_Vtbl { pub base__ : windows_core::IUnknown_Vtbl , # [cfg (feature = "ServiceFabric_FabricTypes")] pub get_ReplicatorStatus : unsafe extern "system" fn (* mut core::ffi::c_void ,) -> * const super::FabricTypes::FABRIC_REPLICATOR_STATUS_QUERY_RESULT , # [cfg (not (feature = "ServiceFabric_FabricTypes"))] get_ReplicatorStatus : usize , }
unsafe impl Send for IFabricGetReplicatorStatusResult {}
unsafe impl Sync for IFabricGetReplicatorStatusResult {}
#[cfg(feature = "ServiceFabric_FabricTypes")]
pub trait IFabricGetReplicatorStatusResult_Impl: windows_core::IUnknownImpl {
    fn get_ReplicatorStatus(
        &self,
    ) -> *const super::FabricTypes::FABRIC_REPLICATOR_STATUS_QUERY_RESULT;
}
#[cfg(feature = "ServiceFabric_FabricTypes")]
impl IFabricGetReplicatorStatusResult_Vtbl {
    pub const fn new<Identity: IFabricGetReplicatorStatusResult_Impl, const OFFSET: isize>() -> Self
    {
        unsafe extern "system" fn get_ReplicatorStatus<
            Identity: IFabricGetReplicatorStatusResult_Impl,
            const OFFSET: isize,
        >(
            this: *mut core::ffi::c_void,
        ) -> *const super::FabricTypes::FABRIC_REPLICATOR_STATUS_QUERY_RESULT {
            unsafe {
                let this: &Identity =
                    &*((this as *const *const ()).offset(OFFSET) as *const Identity);
                IFabricGetReplicatorStatusResult_Impl::get_ReplicatorStatus(this)
            }
        }
        Self {
            base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
            get_ReplicatorStatus: get_ReplicatorStatus::<Identity, OFFSET>,
        }
    }
    pub fn matches(iid: &windows_core::GUID) -> bool {
        iid == &<IFabricGetReplicatorStatusResult as windows_core::Interface>::IID
    }
}
#[cfg(feature = "ServiceFabric_FabricTypes")]
impl windows_core::RuntimeName for IFabricGetReplicatorStatusResult {}
windows_core::imp::define_interface!(
    IFabricStringListResult,
    IFabricStringListResult_Vtbl,
    0xafab1c53_757b_4b0e_8b7e_237aeee6bfe9
);
windows_core::imp::interface_hierarchy!(IFabricStringListResult, windows_core::IUnknown);
impl IFabricStringListResult {
    pub unsafe fn GetStrings(
        &self,
        itemcount: *mut u32,
    ) -> windows_core::Result<*mut windows_core::PCWSTR> {
        unsafe {
            let mut result__ = core::mem::zeroed();
            (windows_core::Interface::vtable(self).GetStrings)(
                windows_core::Interface::as_raw(self),
                itemcount as _,
                &mut result__,
            )
            .map(|| result__)
        }
    }
}
#[repr(C)]
#[doc(hidden)]
pub struct IFabricStringListResult_Vtbl {
    pub base__: windows_core::IUnknown_Vtbl,
    pub GetStrings: unsafe extern "system" fn(
        *mut core::ffi::c_void,
        *mut u32,
        *mut *mut windows_core::PCWSTR,
    ) -> windows_core::HRESULT,
}
unsafe impl Send for IFabricStringListResult {}
unsafe impl Sync for IFabricStringListResult {}
pub trait IFabricStringListResult_Impl: windows_core::IUnknownImpl {
    fn GetStrings(&self, itemcount: *mut u32) -> windows_core::Result<*mut windows_core::PCWSTR>;
}
impl IFabricStringListResult_Vtbl {
    pub const fn new<Identity: IFabricStringListResult_Impl, const OFFSET: isize>() -> Self {
        unsafe extern "system" fn GetStrings<
            Identity: IFabricStringListResult_Impl,
            const OFFSET: isize,
        >(
            this: *mut core::ffi::c_void,
            itemcount: *mut u32,
            buffereditems: *mut *mut windows_core::PCWSTR,
        ) -> windows_core::HRESULT {
            unsafe {
                let this: &Identity =
                    &*((this as *const *const ()).offset(OFFSET) as *const Identity);
                match IFabricStringListResult_Impl::GetStrings(
                    this,
                    core::mem::transmute_copy(&itemcount),
                ) {
                    Ok(ok__) => {
                        buffereditems.write(ok__);
                        windows_core::HRESULT(0)
                    }
                    Err(err) => err.into(),
                }
            }
        }
        Self {
            base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
            GetStrings: GetStrings::<Identity, OFFSET>,
        }
    }
    pub fn matches(iid: &windows_core::GUID) -> bool {
        iid == &<IFabricStringListResult as windows_core::Interface>::IID
    }
}
impl windows_core::RuntimeName for IFabricStringListResult {}
windows_core::imp::define_interface!(
    IFabricStringResult,
    IFabricStringResult_Vtbl,
    0x4ae69614_7d0f_4cd4_b836_23017000d132
);
windows_core::imp::interface_hierarchy!(IFabricStringResult, windows_core::IUnknown);
impl IFabricStringResult {
    pub unsafe fn get_String(&self) -> windows_core::PCWSTR {
        unsafe {
            (windows_core::Interface::vtable(self).get_String)(windows_core::Interface::as_raw(
                self,
            ))
        }
    }
}
#[repr(C)]
#[doc(hidden)]
pub struct IFabricStringResult_Vtbl {
    pub base__: windows_core::IUnknown_Vtbl,
    pub get_String: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::PCWSTR,
}
unsafe impl Send for IFabricStringResult {}
unsafe impl Sync for IFabricStringResult {}
pub trait IFabricStringResult_Impl: windows_core::IUnknownImpl {
    fn get_String(&self) -> windows_core::PCWSTR;
}
impl IFabricStringResult_Vtbl {
    pub const fn new<Identity: IFabricStringResult_Impl, const OFFSET: isize>() -> Self {
        unsafe extern "system" fn get_String<
            Identity: IFabricStringResult_Impl,
            const OFFSET: isize,
        >(
            this: *mut core::ffi::c_void,
        ) -> windows_core::PCWSTR {
            unsafe {
                let this: &Identity =
                    &*((this as *const *const ()).offset(OFFSET) as *const Identity);
                IFabricStringResult_Impl::get_String(this)
            }
        }
        Self {
            base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
            get_String: get_String::<Identity, OFFSET>,
        }
    }
    pub fn matches(iid: &windows_core::GUID) -> bool {
        iid == &<IFabricStringResult as windows_core::Interface>::IID
    }
}
impl windows_core::RuntimeName for IFabricStringResult {}