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
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
#[allow(
    unused_variables,
    non_upper_case_globals,
    non_snake_case,
    unused_unsafe,
    non_camel_case_types,
    dead_code,
    clippy::all
)]
pub mod Windows {
    #[allow(
        unused_variables,
        non_upper_case_globals,
        non_snake_case,
        unused_unsafe,
        non_camel_case_types,
        dead_code,
        clippy::all
    )]
    pub mod Win32 {
        #[allow(
            unused_variables,
            non_upper_case_globals,
            non_snake_case,
            unused_unsafe,
            non_camel_case_types,
            dead_code,
            clippy::all
        )]
        pub mod Foundation {
            #[repr(transparent)]
            #[derive(
                :: std :: default :: Default,
                :: std :: clone :: Clone,
                :: std :: marker :: Copy,
                :: std :: cmp :: PartialEq,
                :: std :: cmp :: Eq,
                :: std :: fmt :: Debug,
            )]
            pub struct BOOL(pub i32);
            unsafe impl ::windows::Abi for BOOL {
                type Abi = Self;
                type DefaultType = Self;
            }
            impl BOOL {
                #[inline]
                pub fn as_bool(self) -> bool {
                    !(self.0 == 0)
                }
                #[inline]
                pub fn ok(self) -> ::windows::Result<()> {
                    if self.as_bool() {
                        Ok(())
                    } else {
                        Err(::windows::Error::from_win32())
                    }
                }
                #[inline]
                #[track_caller]
                pub fn unwrap(self) {
                    self.ok().unwrap();
                }
                #[inline]
                #[track_caller]
                pub fn expect(self, msg: &str) {
                    self.ok().expect(msg);
                }
            }
            impl ::std::convert::From<BOOL> for bool {
                fn from(value: BOOL) -> Self {
                    value.as_bool()
                }
            }
            impl ::std::convert::From<&BOOL> for bool {
                fn from(value: &BOOL) -> Self {
                    value.as_bool()
                }
            }
            impl ::std::convert::From<bool> for BOOL {
                fn from(value: bool) -> Self {
                    if value {
                        BOOL(1)
                    } else {
                        BOOL(0)
                    }
                }
            }
            impl ::std::convert::From<&bool> for BOOL {
                fn from(value: &bool) -> Self {
                    (*value).into()
                }
            }
            impl ::std::cmp::PartialEq<bool> for BOOL {
                fn eq(&self, other: &bool) -> bool {
                    self.as_bool() == *other
                }
            }
            impl ::std::cmp::PartialEq<BOOL> for bool {
                fn eq(&self, other: &BOOL) -> bool {
                    *self == other.as_bool()
                }
            }
            impl std::ops::Not for BOOL {
                type Output = Self;
                fn not(self) -> Self::Output {
                    if self.as_bool() {
                        BOOL(0)
                    } else {
                        BOOL(1)
                    }
                }
            }
            impl<'a> ::windows::IntoParam<'a, BOOL> for bool {
                fn into_param(self) -> ::windows::Param<'a, BOOL> {
                    ::windows::Param::Owned(self.into())
                }
            }
            #[derive(
                :: std :: clone :: Clone,
                :: std :: marker :: Copy,
                :: std :: default :: Default,
                :: std :: fmt :: Debug,
                :: std :: cmp :: PartialEq,
                :: std :: cmp :: Eq,
            )]
            #[repr(transparent)]
            pub struct HANDLE(pub isize);
            unsafe impl ::windows::Handle for HANDLE {
                fn is_invalid(&self) -> bool {
                    self.0 == 0 || self.0 == -1
                }
                fn ok(self) -> ::windows::Result<Self> {
                    if self.is_invalid() {
                        Err(::windows::Error::from_win32())
                    } else {
                        Ok(self)
                    }
                }
            }
            unsafe impl ::windows::Abi for HANDLE {
                type Abi = Self;
                type DefaultType = Self;
            }
            #[derive(
                :: std :: clone :: Clone,
                :: std :: marker :: Copy,
                :: std :: fmt :: Debug,
                :: std :: cmp :: PartialEq,
                :: std :: cmp :: Eq,
            )]
            #[repr(transparent)]
            pub struct PWSTR(pub *mut u16);
            impl PWSTR {
                pub fn is_null(&self) -> bool {
                    self.0.is_null()
                }
            }
            impl ::std::default::Default for PWSTR {
                fn default() -> Self {
                    Self(::std::ptr::null_mut())
                }
            }
            unsafe impl ::windows::Abi for PWSTR {
                type Abi = Self;
                type DefaultType = Self;
                unsafe fn drop_param(param: &mut ::windows::Param<'_, Self>) {
                    if let ::windows::Param::Boxed(value) = param {
                        if !value.is_null() {
                            unsafe {
                                ::std::boxed::Box::from_raw(value.0);
                            }
                        }
                    }
                }
            }
            impl<'a> ::windows::IntoParam<'a, PWSTR> for &str {
                fn into_param(self) -> ::windows::Param<'a, PWSTR> {
                    ::windows::Param::Boxed(PWSTR(::std::boxed::Box::<[u16]>::into_raw(
                        self.encode_utf16()
                            .chain(::std::iter::once(0))
                            .collect::<std::vec::Vec<u16>>()
                            .into_boxed_slice(),
                    ) as _))
                }
            }
            impl<'a> ::windows::IntoParam<'a, PWSTR> for String {
                fn into_param(self) -> ::windows::Param<'a, PWSTR> {
                    ::windows::Param::Boxed(PWSTR(::std::boxed::Box::<[u16]>::into_raw(
                        self.encode_utf16()
                            .chain(::std::iter::once(0))
                            .collect::<std::vec::Vec<u16>>()
                            .into_boxed_slice(),
                    ) as _))
                }
            }
            #[cfg(windows)]
            impl<'a> ::windows::IntoParam<'a, PWSTR> for &::std::ffi::OsStr {
                fn into_param(self) -> ::windows::Param<'a, PWSTR> {
                    use std::os::windows::ffi::OsStrExt;
                    ::windows::Param::Boxed(PWSTR(::std::boxed::Box::<[u16]>::into_raw(
                        self.encode_wide()
                            .chain(::std::iter::once(0))
                            .collect::<std::vec::Vec<u16>>()
                            .into_boxed_slice(),
                    ) as _))
                }
            }
            #[cfg(windows)]
            impl<'a> ::windows::IntoParam<'a, PWSTR> for ::std::ffi::OsString {
                fn into_param(self) -> ::windows::Param<'a, PWSTR> {
                    use std::os::windows::ffi::OsStrExt;
                    ::windows::Param::Boxed(PWSTR(::std::boxed::Box::<[u16]>::into_raw(
                        self.encode_wide()
                            .chain(::std::iter::once(0))
                            .collect::<std::vec::Vec<u16>>()
                            .into_boxed_slice(),
                    ) as _))
                }
            }
        }
        #[allow(
            unused_variables,
            non_upper_case_globals,
            non_snake_case,
            unused_unsafe,
            non_camel_case_types,
            dead_code,
            clippy::all
        )]
        pub mod System {
            #[allow(
                unused_variables,
                non_upper_case_globals,
                non_snake_case,
                unused_unsafe,
                non_camel_case_types,
                dead_code,
                clippy::all
            )]
            pub mod Diagnostics {
                #[allow(
                    unused_variables,
                    non_upper_case_globals,
                    non_snake_case,
                    unused_unsafe,
                    non_camel_case_types,
                    dead_code,
                    clippy::all
                )]
                pub mod Debug {
                    pub unsafe fn GetLastError() -> WIN32_ERROR {
                        #[cfg(windows)]
                        {
                            #[link(name = "kernel32")]
                            extern "system" {
                                fn GetLastError() -> WIN32_ERROR;
                            }
                            ::std::mem::transmute(GetLastError())
                        }
                        #[cfg(not(windows))]
                        unimplemented!("Unsupported target OS");
                    }
                    #[derive(
                        :: std :: cmp :: PartialEq,
                        :: std :: cmp :: Eq,
                        :: std :: marker :: Copy,
                        :: std :: clone :: Clone,
                        :: std :: default :: Default,
                        :: std :: fmt :: Debug,
                    )]
                    #[repr(transparent)]
                    pub struct WIN32_ERROR(pub u32);
                    impl ::std::convert::From<u32> for WIN32_ERROR {
                        fn from(value: u32) -> Self {
                            Self(value)
                        }
                    }
                    unsafe impl ::windows::Abi for WIN32_ERROR {
                        type Abi = Self;
                        type DefaultType = Self;
                    }
                    impl ::std::ops::BitOr for WIN32_ERROR {
                        type Output = Self;
                        fn bitor(self, rhs: Self) -> Self {
                            Self(self.0 | rhs.0)
                        }
                    }
                    impl ::std::ops::BitAnd for WIN32_ERROR {
                        type Output = Self;
                        fn bitand(self, rhs: Self) -> Self {
                            Self(self.0 & rhs.0)
                        }
                    }
                    impl ::std::ops::BitOrAssign for WIN32_ERROR {
                        fn bitor_assign(&mut self, rhs: Self) {
                            self.0.bitor_assign(rhs.0)
                        }
                    }
                    impl ::std::ops::BitAndAssign for WIN32_ERROR {
                        fn bitand_assign(&mut self, rhs: Self) {
                            self.0.bitand_assign(rhs.0)
                        }
                    }
                    impl ::std::ops::Not for WIN32_ERROR {
                        type Output = Self;
                        fn not(self) -> Self {
                            Self(self.0.not())
                        }
                    }
                    impl ::std::convert::From<WIN32_ERROR> for ::windows::HRESULT {
                        fn from(value: WIN32_ERROR) -> Self {
                            Self(if value.0 as i32 <= 0 {
                                value.0
                            } else {
                                (value.0 & 0x0000_FFFF) | (7 << 16) | 0x8000_0000
                            })
                        }
                    }
                }
            }
            #[allow(
                unused_variables,
                non_upper_case_globals,
                non_snake_case,
                unused_unsafe,
                non_camel_case_types,
                dead_code,
                clippy::all
            )]
            pub mod RemoteDesktop {
                #[derive(:: std :: clone :: Clone, :: std :: marker :: Copy)]
                #[repr(C)]
                pub struct WTSCLIENTW {
                    pub ClientName: [u16; 21],
                    pub Domain: [u16; 18],
                    pub UserName: [u16; 21],
                    pub WorkDirectory: [u16; 261],
                    pub InitialProgram: [u16; 261],
                    pub EncryptionLevel: u8,
                    pub ClientAddressFamily: u32,
                    pub ClientAddress: [u16; 31],
                    pub HRes: u16,
                    pub VRes: u16,
                    pub ColorDepth: u16,
                    pub ClientDirectory: [u16; 261],
                    pub ClientBuildNumber: u32,
                    pub ClientHardwareId: u32,
                    pub ClientProductId: u16,
                    pub OutBufCountHost: u16,
                    pub OutBufCountClient: u16,
                    pub OutBufLength: u16,
                    pub DeviceId: [u16; 261],
                }
                impl WTSCLIENTW {}
                impl ::std::default::Default for WTSCLIENTW {
                    fn default() -> Self {
                        unsafe { ::std::mem::zeroed() }
                    }
                }
                impl ::std::fmt::Debug for WTSCLIENTW {
                    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                        fmt.debug_struct("WTSCLIENTW")
                            .field("ClientName", &self.ClientName)
                            .field("Domain", &self.Domain)
                            .field("UserName", &self.UserName)
                            .field("WorkDirectory", &self.WorkDirectory)
                            .field("InitialProgram", &self.InitialProgram)
                            .field("EncryptionLevel", &self.EncryptionLevel)
                            .field("ClientAddressFamily", &self.ClientAddressFamily)
                            .field("ClientAddress", &self.ClientAddress)
                            .field("HRes", &self.HRes)
                            .field("VRes", &self.VRes)
                            .field("ColorDepth", &self.ColorDepth)
                            .field("ClientDirectory", &self.ClientDirectory)
                            .field("ClientBuildNumber", &self.ClientBuildNumber)
                            .field("ClientHardwareId", &self.ClientHardwareId)
                            .field("ClientProductId", &self.ClientProductId)
                            .field("OutBufCountHost", &self.OutBufCountHost)
                            .field("OutBufCountClient", &self.OutBufCountClient)
                            .field("OutBufLength", &self.OutBufLength)
                            .field("DeviceId", &self.DeviceId)
                            .finish()
                    }
                }
                impl ::std::cmp::PartialEq for WTSCLIENTW {
                    fn eq(&self, other: &Self) -> bool {
                        self.ClientName == other.ClientName
                            && self.Domain == other.Domain
                            && self.UserName == other.UserName
                            && self.WorkDirectory == other.WorkDirectory
                            && self.InitialProgram == other.InitialProgram
                            && self.EncryptionLevel == other.EncryptionLevel
                            && self.ClientAddressFamily == other.ClientAddressFamily
                            && self.ClientAddress == other.ClientAddress
                            && self.HRes == other.HRes
                            && self.VRes == other.VRes
                            && self.ColorDepth == other.ColorDepth
                            && self.ClientDirectory == other.ClientDirectory
                            && self.ClientBuildNumber == other.ClientBuildNumber
                            && self.ClientHardwareId == other.ClientHardwareId
                            && self.ClientProductId == other.ClientProductId
                            && self.OutBufCountHost == other.OutBufCountHost
                            && self.OutBufCountClient == other.OutBufCountClient
                            && self.OutBufLength == other.OutBufLength
                            && self.DeviceId == other.DeviceId
                    }
                }
                impl ::std::cmp::Eq for WTSCLIENTW {}
                unsafe impl ::windows::Abi for WTSCLIENTW {
                    type Abi = Self;
                    type DefaultType = Self;
                }
                pub unsafe fn WTSCloseServer<
                    'a,
                    Param0: ::windows::IntoParam<'a, super::super::Foundation::HANDLE>,
                >(
                    hserver: Param0,
                ) {
                    #[cfg(windows)]
                    {
                        #[link(name = "wtsapi32")]
                        extern "system" {
                            fn WTSCloseServer(hserver: super::super::Foundation::HANDLE);
                        }
                        ::std::mem::transmute(WTSCloseServer(hserver.into_param().abi()))
                    }
                    #[cfg(not(windows))]
                    unimplemented!("Unsupported target OS");
                }
                pub unsafe fn WTSEnumerateSessionsW<
                    'a,
                    Param0: ::windows::IntoParam<'a, super::super::Foundation::HANDLE>,
                >(
                    hserver: Param0,
                    reserved: u32,
                    version: u32,
                    ppsessioninfo: *mut *mut WTS_SESSION_INFOW,
                    pcount: *mut u32,
                ) -> super::super::Foundation::BOOL {
                    #[cfg(windows)]
                    {
                        #[link(name = "wtsapi32")]
                        extern "system" {
                            fn WTSEnumerateSessionsW(
                                hserver: super::super::Foundation::HANDLE,
                                reserved: u32,
                                version: u32,
                                ppsessioninfo: *mut *mut WTS_SESSION_INFOW,
                                pcount: *mut u32,
                            ) -> super::super::Foundation::BOOL;
                        }
                        ::std::mem::transmute(WTSEnumerateSessionsW(
                            hserver.into_param().abi(),
                            ::std::mem::transmute(reserved),
                            ::std::mem::transmute(version),
                            ::std::mem::transmute(ppsessioninfo),
                            ::std::mem::transmute(pcount),
                        ))
                    }
                    #[cfg(not(windows))]
                    unimplemented!("Unsupported target OS");
                }
                pub unsafe fn WTSFreeMemory(pmemory: *mut ::std::ffi::c_void) {
                    #[cfg(windows)]
                    {
                        #[link(name = "wtsapi32")]
                        extern "system" {
                            fn WTSFreeMemory(pmemory: *mut ::std::ffi::c_void);
                        }
                        ::std::mem::transmute(WTSFreeMemory(::std::mem::transmute(pmemory)))
                    }
                    #[cfg(not(windows))]
                    unimplemented!("Unsupported target OS");
                }
                pub unsafe fn WTSOpenServerW<
                    'a,
                    Param0: ::windows::IntoParam<'a, super::super::Foundation::PWSTR>,
                >(
                    pservername: Param0,
                ) -> super::super::Foundation::HANDLE {
                    #[cfg(windows)]
                    {
                        #[link(name = "wtsapi32")]
                        extern "system" {
                            fn WTSOpenServerW(
                                pservername: super::super::Foundation::PWSTR,
                            ) -> super::super::Foundation::HANDLE;
                        }
                        ::std::mem::transmute(WTSOpenServerW(pservername.into_param().abi()))
                    }
                    #[cfg(not(windows))]
                    unimplemented!("Unsupported target OS");
                }
                pub unsafe fn WTSQuerySessionInformationW<
                    'a,
                    Param0: ::windows::IntoParam<'a, super::super::Foundation::HANDLE>,
                >(
                    hserver: Param0,
                    sessionid: u32,
                    wtsinfoclass: WTS_INFO_CLASS,
                    ppbuffer: *mut super::super::Foundation::PWSTR,
                    pbytesreturned: *mut u32,
                ) -> super::super::Foundation::BOOL {
                    #[cfg(windows)]
                    {
                        #[link(name = "wtsapi32")]
                        extern "system" {
                            fn WTSQuerySessionInformationW(
                                hserver: super::super::Foundation::HANDLE,
                                sessionid: u32,
                                wtsinfoclass: WTS_INFO_CLASS,
                                ppbuffer: *mut super::super::Foundation::PWSTR,
                                pbytesreturned: *mut u32,
                            ) -> super::super::Foundation::BOOL;
                        }
                        ::std::mem::transmute(WTSQuerySessionInformationW(
                            hserver.into_param().abi(),
                            ::std::mem::transmute(sessionid),
                            ::std::mem::transmute(wtsinfoclass),
                            ::std::mem::transmute(ppbuffer),
                            ::std::mem::transmute(pbytesreturned),
                        ))
                    }
                    #[cfg(not(windows))]
                    unimplemented!("Unsupported target OS");
                }
                #[derive(
                    :: std :: cmp :: PartialEq,
                    :: std :: cmp :: Eq,
                    :: std :: marker :: Copy,
                    :: std :: clone :: Clone,
                    :: std :: default :: Default,
                    :: std :: fmt :: Debug,
                )]
                #[repr(transparent)]
                pub struct WTS_CONNECTSTATE_CLASS(pub i32);
                pub const WTSActive: WTS_CONNECTSTATE_CLASS = WTS_CONNECTSTATE_CLASS(0i32);
                pub const WTSConnected: WTS_CONNECTSTATE_CLASS = WTS_CONNECTSTATE_CLASS(1i32);
                pub const WTSConnectQuery: WTS_CONNECTSTATE_CLASS = WTS_CONNECTSTATE_CLASS(2i32);
                pub const WTSShadow: WTS_CONNECTSTATE_CLASS = WTS_CONNECTSTATE_CLASS(3i32);
                pub const WTSDisconnected: WTS_CONNECTSTATE_CLASS = WTS_CONNECTSTATE_CLASS(4i32);
                pub const WTSIdle: WTS_CONNECTSTATE_CLASS = WTS_CONNECTSTATE_CLASS(5i32);
                pub const WTSListen: WTS_CONNECTSTATE_CLASS = WTS_CONNECTSTATE_CLASS(6i32);
                pub const WTSReset: WTS_CONNECTSTATE_CLASS = WTS_CONNECTSTATE_CLASS(7i32);
                pub const WTSDown: WTS_CONNECTSTATE_CLASS = WTS_CONNECTSTATE_CLASS(8i32);
                pub const WTSInit: WTS_CONNECTSTATE_CLASS = WTS_CONNECTSTATE_CLASS(9i32);
                impl ::std::convert::From<i32> for WTS_CONNECTSTATE_CLASS {
                    fn from(value: i32) -> Self {
                        Self(value)
                    }
                }
                unsafe impl ::windows::Abi for WTS_CONNECTSTATE_CLASS {
                    type Abi = Self;
                    type DefaultType = Self;
                }
                #[derive(
                    :: std :: cmp :: PartialEq,
                    :: std :: cmp :: Eq,
                    :: std :: marker :: Copy,
                    :: std :: clone :: Clone,
                    :: std :: default :: Default,
                    :: std :: fmt :: Debug,
                )]
                #[repr(transparent)]
                pub struct WTS_INFO_CLASS(pub i32);
                pub const WTSInitialProgram: WTS_INFO_CLASS = WTS_INFO_CLASS(0i32);
                pub const WTSApplicationName: WTS_INFO_CLASS = WTS_INFO_CLASS(1i32);
                pub const WTSWorkingDirectory: WTS_INFO_CLASS = WTS_INFO_CLASS(2i32);
                pub const WTSOEMId: WTS_INFO_CLASS = WTS_INFO_CLASS(3i32);
                pub const WTSSessionId: WTS_INFO_CLASS = WTS_INFO_CLASS(4i32);
                pub const WTSUserName: WTS_INFO_CLASS = WTS_INFO_CLASS(5i32);
                pub const WTSWinStationName: WTS_INFO_CLASS = WTS_INFO_CLASS(6i32);
                pub const WTSDomainName: WTS_INFO_CLASS = WTS_INFO_CLASS(7i32);
                pub const WTSConnectState: WTS_INFO_CLASS = WTS_INFO_CLASS(8i32);
                pub const WTSClientBuildNumber: WTS_INFO_CLASS = WTS_INFO_CLASS(9i32);
                pub const WTSClientName: WTS_INFO_CLASS = WTS_INFO_CLASS(10i32);
                pub const WTSClientDirectory: WTS_INFO_CLASS = WTS_INFO_CLASS(11i32);
                pub const WTSClientProductId: WTS_INFO_CLASS = WTS_INFO_CLASS(12i32);
                pub const WTSClientHardwareId: WTS_INFO_CLASS = WTS_INFO_CLASS(13i32);
                pub const WTSClientAddress: WTS_INFO_CLASS = WTS_INFO_CLASS(14i32);
                pub const WTSClientDisplay: WTS_INFO_CLASS = WTS_INFO_CLASS(15i32);
                pub const WTSClientProtocolType: WTS_INFO_CLASS = WTS_INFO_CLASS(16i32);
                pub const WTSIdleTime: WTS_INFO_CLASS = WTS_INFO_CLASS(17i32);
                pub const WTSLogonTime: WTS_INFO_CLASS = WTS_INFO_CLASS(18i32);
                pub const WTSIncomingBytes: WTS_INFO_CLASS = WTS_INFO_CLASS(19i32);
                pub const WTSOutgoingBytes: WTS_INFO_CLASS = WTS_INFO_CLASS(20i32);
                pub const WTSIncomingFrames: WTS_INFO_CLASS = WTS_INFO_CLASS(21i32);
                pub const WTSOutgoingFrames: WTS_INFO_CLASS = WTS_INFO_CLASS(22i32);
                pub const WTSClientInfo: WTS_INFO_CLASS = WTS_INFO_CLASS(23i32);
                pub const WTSSessionInfo: WTS_INFO_CLASS = WTS_INFO_CLASS(24i32);
                pub const WTSSessionInfoEx: WTS_INFO_CLASS = WTS_INFO_CLASS(25i32);
                pub const WTSConfigInfo: WTS_INFO_CLASS = WTS_INFO_CLASS(26i32);
                pub const WTSValidationInfo: WTS_INFO_CLASS = WTS_INFO_CLASS(27i32);
                pub const WTSSessionAddressV4: WTS_INFO_CLASS = WTS_INFO_CLASS(28i32);
                pub const WTSIsRemoteSession: WTS_INFO_CLASS = WTS_INFO_CLASS(29i32);
                impl ::std::convert::From<i32> for WTS_INFO_CLASS {
                    fn from(value: i32) -> Self {
                        Self(value)
                    }
                }
                unsafe impl ::windows::Abi for WTS_INFO_CLASS {
                    type Abi = Self;
                    type DefaultType = Self;
                }
                #[derive(:: std :: clone :: Clone, :: std :: marker :: Copy)]
                #[repr(C)]
                pub struct WTS_SESSION_INFOW {
                    pub SessionId: u32,
                    pub pWinStationName: super::super::Foundation::PWSTR,
                    pub State: WTS_CONNECTSTATE_CLASS,
                }
                impl WTS_SESSION_INFOW {}
                impl ::std::default::Default for WTS_SESSION_INFOW {
                    fn default() -> Self {
                        unsafe { ::std::mem::zeroed() }
                    }
                }
                impl ::std::fmt::Debug for WTS_SESSION_INFOW {
                    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
                        fmt.debug_struct("WTS_SESSION_INFOW")
                            .field("SessionId", &self.SessionId)
                            .field("pWinStationName", &self.pWinStationName)
                            .field("State", &self.State)
                            .finish()
                    }
                }
                impl ::std::cmp::PartialEq for WTS_SESSION_INFOW {
                    fn eq(&self, other: &Self) -> bool {
                        self.SessionId == other.SessionId
                            && self.pWinStationName == other.pWinStationName
                            && self.State == other.State
                    }
                }
                impl ::std::cmp::Eq for WTS_SESSION_INFOW {}
                unsafe impl ::windows::Abi for WTS_SESSION_INFOW {
                    type Abi = Self;
                    type DefaultType = Self;
                }
            }
            #[allow(
                unused_variables,
                non_upper_case_globals,
                non_snake_case,
                unused_unsafe,
                non_camel_case_types,
                dead_code,
                clippy::all
            )]
            pub mod SystemInformation {
                #[derive(
                    :: std :: cmp :: PartialEq,
                    :: std :: cmp :: Eq,
                    :: std :: marker :: Copy,
                    :: std :: clone :: Clone,
                    :: std :: default :: Default,
                    :: std :: fmt :: Debug,
                )]
                #[repr(transparent)]
                pub struct COMPUTER_NAME_FORMAT(pub i32);
                pub const ComputerNameNetBIOS: COMPUTER_NAME_FORMAT = COMPUTER_NAME_FORMAT(0i32);
                pub const ComputerNameDnsHostname: COMPUTER_NAME_FORMAT =
                    COMPUTER_NAME_FORMAT(1i32);
                pub const ComputerNameDnsDomain: COMPUTER_NAME_FORMAT = COMPUTER_NAME_FORMAT(2i32);
                pub const ComputerNameDnsFullyQualified: COMPUTER_NAME_FORMAT =
                    COMPUTER_NAME_FORMAT(3i32);
                pub const ComputerNamePhysicalNetBIOS: COMPUTER_NAME_FORMAT =
                    COMPUTER_NAME_FORMAT(4i32);
                pub const ComputerNamePhysicalDnsHostname: COMPUTER_NAME_FORMAT =
                    COMPUTER_NAME_FORMAT(5i32);
                pub const ComputerNamePhysicalDnsDomain: COMPUTER_NAME_FORMAT =
                    COMPUTER_NAME_FORMAT(6i32);
                pub const ComputerNamePhysicalDnsFullyQualified: COMPUTER_NAME_FORMAT =
                    COMPUTER_NAME_FORMAT(7i32);
                pub const ComputerNameMax: COMPUTER_NAME_FORMAT = COMPUTER_NAME_FORMAT(8i32);
                impl ::std::convert::From<i32> for COMPUTER_NAME_FORMAT {
                    fn from(value: i32) -> Self {
                        Self(value)
                    }
                }
                unsafe impl ::windows::Abi for COMPUTER_NAME_FORMAT {
                    type Abi = Self;
                    type DefaultType = Self;
                }
                pub unsafe fn GetComputerNameExW(
                    nametype: COMPUTER_NAME_FORMAT,
                    lpbuffer: super::super::Foundation::PWSTR,
                    nsize: *mut u32,
                ) -> super::super::Foundation::BOOL {
                    #[cfg(windows)]
                    {
                        #[link(name = "kernel32")]
                        extern "system" {
                            fn GetComputerNameExW(
                                nametype: COMPUTER_NAME_FORMAT,
                                lpbuffer: super::super::Foundation::PWSTR,
                                nsize: *mut u32,
                            ) -> super::super::Foundation::BOOL;
                        }
                        ::std::mem::transmute(GetComputerNameExW(
                            ::std::mem::transmute(nametype),
                            ::std::mem::transmute(lpbuffer),
                            ::std::mem::transmute(nsize),
                        ))
                    }
                    #[cfg(not(windows))]
                    unimplemented!("Unsupported target OS");
                }
            }
            #[allow(
                unused_variables,
                non_upper_case_globals,
                non_snake_case,
                unused_unsafe,
                non_camel_case_types,
                dead_code,
                clippy::all
            )]
            pub mod WindowsProgramming {
                pub unsafe fn GetUserNameW(
                    lpbuffer: super::super::Foundation::PWSTR,
                    pcbbuffer: *mut u32,
                ) -> super::super::Foundation::BOOL {
                    #[cfg(windows)]
                    {
                        #[link(name = "advapi32")]
                        extern "system" {
                            fn GetUserNameW(
                                lpbuffer: super::super::Foundation::PWSTR,
                                pcbbuffer: *mut u32,
                            ) -> super::super::Foundation::BOOL;
                        }
                        ::std::mem::transmute(GetUserNameW(
                            ::std::mem::transmute(lpbuffer),
                            ::std::mem::transmute(pcbbuffer),
                        ))
                    }
                    #[cfg(not(windows))]
                    unimplemented!("Unsupported target OS");
                }
            }
        }
    }
}