apiw-sys 0.1.0

This crate provides core API bindings for Windows according to ECMA-234.
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
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
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
#![allow(unused_doc_comments)]
#[cfg(feature = "system-services-comm")]
use windows_sys::Win32::Devices::Communication as comm;
#[cfg(all(
    feature = "system-services-modules-and-symbols",
    feature = "system-services-defaultheapmemobjs-global",
    feature = "system-services-defaultheapmemobjs-local",
    feature = "system-services-winmain",
))]
use windows_sys::Win32::Foundation as winsys_foundation;
#[cfg(feature = "system-services-resource")]
use windows_sys::Win32::Graphics::Gdi as gdi;
#[cfg(any(
    feature = "system-services-syspathname",
    feature = "system-services-drivetype",
    feature = "system-services-fileop-deprecated",
))]
use windows_sys::Win32::Storage::FileSystem as storefs;
#[cfg(all(
    feature = "system-services-modules-and-symbols",
    feature = "system-services-resource",
))]
use windows_sys::Win32::System::LibraryLoader as libloader;
#[cfg(all(
    feature = "system-services-defaultheapmemobjs-global",
    feature = "system-services-defaultheapmemobjs-local",
    feature = "system-services-ptrvalidate",
))]
use windows_sys::Win32::System::Memory as sysmem;
#[cfg(feature = "system-services-regop")]
use windows_sys::Win32::System::Registry as sysreg;
#[cfg(feature = "system-services-shutdown")]
use windows_sys::Win32::System::Shutdown as sysshutdown;
#[cfg(all(
    feature = "system-services-version",
    feature = "system-services-clock",
    feature = "system-services-syspathname",
))]
use windows_sys::Win32::System::SystemInformation as sysinfo;
#[cfg(feature = "system-services-winexec")]
use windows_sys::Win32::System::Threading as systhread;
#[cfg(any(
    feature = "system-services-defaultheapmemobjs-global",
    feature = "system-services-defaultheapmemobjs-local",
    feature = "system-services-fileop-deprecated",
))]
use windows_sys::Win32::System::WindowsProgramming as winprg;
#[cfg(any(
    feature = "system-services-params-and-metrics",
    feature = "system-services-inputstate"
))]
use windows_sys::Win32::UI::Input::KeyboardAndMouse as kbdmse;
#[cfg(feature = "system-services-winhelp")]
use windows_sys::Win32::UI::Shell as shell;
#[cfg(any(
    feature = "system-services-params-and-metrics",
    feature = "system-services-timer",
    feature = "system-services-inputstate",
    feature = "system-services-resource",
))]
use windows_sys::Win32::UI::WindowsAndMessaging as winmsg;
#[cfg(any(
    feature = "system-services-winmain",
    feature = "system-services-shutdown"
))]
use windows_sys::core as wincore;

/// `#305` GetFreeSystemResources
///
/// determines the percentage of free space available for all system resources
/// or a system resource of a specific type
removed_item!(
    pub use winmsg::GetFreeSystemResources;
);

/// `#306` SystemParametersInfo
///
/// gets or sets a specific type of system information
#[cfg(feature = "system-services-params-and-metrics")]
pub use winmsg::SystemParametersInfoW as SystemParametersInfo;

/// `#307` GetWinFlags
///
/// gets the system and memory configuration
removed_item!(
    pub use winmsg::GetWinFlags;
);

/// `#308` GetSystemMetrics
///
/// retrieves information about the width and height, in pixels, of the various
/// elements displayed by the system and also retrieves some other miscellaneous
/// system information
#[cfg(feature = "system-services-params-and-metrics")]
pub use winmsg::GetSystemMetrics;

/// `#309` GetVersion
///
/// retrieves the current versions of both Windows and MS-DOS
#[cfg(feature = "system-services-version")]
pub use sysinfo::GetVersion;

/// `#310` SetTimer
///
/// creates a new system timer
#[cfg(feature = "system-services-timer")]
pub use winmsg::SetTimer;

/// `#310` TimerProc
///
/// an application-defined callback function that processes WM_TIMER messages
#[cfg(feature = "system-services-timer")]
pub type TimerProc = opt_inner_type!(winmsg::TIMERPROC);

/// `#310` KillTimer
///
/// removes a system timer
#[cfg(feature = "system-services-timer")]
pub use winmsg::KillTimer;

/// `#311` SetDoubleClickTime
///
/// sets the maximum number of milliseconds that can occur between the first and
/// second mouse button clicks of a mouse button double-click
#[cfg(feature = "system-services-params-and-metrics")]
pub use kbdmse::SetDoubleClickTime;

/// `#311` GetDoubleClickTime
///
/// returns the maximum number of milliseconds that can occur between the first
/// and second mouse button clicks of a mouse button double-click
#[cfg(feature = "system-services-params-and-metrics")]
pub use kbdmse::GetDoubleClickTime;

/// `#312` GetTickCount
///
/// returns the number of milliseconds that have elapsed since the session
/// started
#[cfg(feature = "system-services-clock")]
pub use sysinfo::GetTickCount;

/// `#312` GetCurrentTime
///
/// identical to the `GetTickCount()` function
removed_item!(
    pub use sysinfo::GetCurrentTime;
);

/// `#313` GetTimerResolution
///
/// returns the number of microseconds for each timer tick
removed_item!(
    pub use sysinfo::GetTimerResolution;
);

/// `#314` LoadLibrary
///
/// load a library module
#[cfg(feature = "system-services-modules-and-symbols")]
pub use libloader::LoadLibraryW as LoadLibrary;

/// `#314` FreeLibrary
///
/// decreases by 1 the reference count of the module identified by the `hInst`
/// parameter
#[cfg(feature = "system-services-modules-and-symbols")]
pub use winsys_foundation::FreeLibrary;

/// `#315` LoadModule
///
/// loads and executes an application module
#[cfg(feature = "system-services-modules-and-symbols")]
pub use libloader::LoadModule;

/// `#315` FreeModule
///
/// decreases by 1 the reference count of the module identified by the `hInst`
/// parameter
removed_item!(
    pub use winsys_foundation::FreeModule;
);

/// `#316` GetModuleFileName
///
/// retrieves the null-terminated filename, including the full path, of the file
/// from which the module specified by `hInst` parameter has been loaded
#[cfg(feature = "system-services-modules-and-symbols")]
pub use libloader::GetModuleFileNameW as GetModuleFileName;

/// `#316` GetModuleHandle
///
/// obtains a handle of the module specified by name in the `lpszModule`
/// parameter
#[cfg(feature = "system-services-modules-and-symbols")]
pub use libloader::GetModuleHandleW as GetModuleHandle;

/// `#316` GetModuleUsage
///
/// returns the reference count for the module specified by `hInst` parameter
removed_item!(
    pub use libloader::GetModuleUsage;
);

/// `#317` GetProcAddress
///
/// retrieves the address of a function in the module specified in the `hInst`
/// parameter
#[cfg(feature = "system-services-modules-and-symbols")]
pub use libloader::GetProcAddress;

/// `#318` MakeProcInstance
///
/// creates a procedure instance of a given function
removed_item!(
    pub use libloader::MakeProcInstance;
);

/// `#318` FreeProcInstance
///
/// frees the procedure instance specified in `lpProc` parameter
removed_item!(
    pub use libloader::FreeProcInstance;
);

/// `#319` LibMain
///
/// entry point of a dynamic-link library (DLL) and is called by the system at
/// the time the DLL is loaded
removed_item!(
    type WORD = u16;
    pub type LibMain = extern "system" fn(
        winsys_foundation::HINSTANCE,
        WORD,
        WORD,
        wincore::LPSTR,
    ) -> wincore::BOOL;
);

/// `#320` WEP
///
/// called by the system at the time the DLL is unloaded
removed_item!(
    pub type WEP = extern "system" fn(i32) -> wincore::BOOL;
);

/// `#321` GetInstanceData
///
/// makes a copy of the previous instance of an application into the data area
/// of the current instance
removed_item!(
    pub use libloader::GetInstanceData;
);

/// `#322` GetFreeSpace
///
/// retrieves the number of bytes of free memory available
removed_item!(
    pub use sysmem::GetFreeSpace;
);

/// `#323` GlobalAlloc
///
/// allocates dwBytes bytes and returns a handle to the memory segment that can
/// be accessed via `GlobalLock()`
#[cfg(feature = "system-services-defaultheapmemobjs-global")]
pub use sysmem::GlobalAlloc;

/// `#323` GlobalFree
///
/// frees the memory segment specified by the handle `hMem`
#[cfg(feature = "system-services-defaultheapmemobjs-global")]
pub use winsys_foundation::GlobalFree;

/// `#323` LocalAlloc
///
/// call the GlobalAlloc() function
#[cfg(feature = "system-services-defaultheapmemobjs-local")]
pub use sysmem::LocalAlloc;

/// `#323` LocalFree
///
/// call the GlobalFree() function
#[cfg(feature = "system-services-defaultheapmemobjs-local")]
pub use winsys_foundation::LocalFree;

/// `#324` GlobalCompact
///
/// rearranges the memory content until `MinFree` bytes of memory can no longer
/// be rearranged
#[cfg(feature = "system-services-defaultheapmemobjs-global")]
pub use winprg::GlobalCompact;

/// `#324` LocalCompact
///
/// calls `GlobalCompact()`
#[cfg(feature = "system-services-defaultheapmemobjs-local")]
pub use winprg::LocalCompact;

/// `#325` GlobalFix
///
/// currently performs no operation.
///
/// originally prevents the global memory object specified in the `hmem`
/// parameter from moving in linear memory
#[cfg(feature = "system-services-defaultheapmemobjs-global")]
pub use winprg::GlobalFix;

/// `#325` GlobalUnfix
///
/// currently performs no operation.
///
/// originally allows the global memory object specified in the `hmem` parameter
/// to be moved in linear memory
#[cfg(feature = "system-services-defaultheapmemobjs-global")]
pub use winprg::GlobalUnfix;

/// `#326` GlobalFlags
///
/// returns the flag associated with the global memory segment specified by the
/// `hMem` parameter
#[cfg(feature = "system-services-defaultheapmemobjs-global")]
pub use sysmem::GlobalFlags;

/// `#326` LocalFlags
///
/// calls `GlobalFlags()`
#[cfg(feature = "system-services-defaultheapmemobjs-local")]
pub use sysmem::LocalFlags;

/// `#327` GlobalHandle
///
/// searches for a memory segment that contains `lpaddress`, and returns its
/// associated handle
#[cfg(feature = "system-services-defaultheapmemobjs-global")]
pub use sysmem::GlobalHandle;

/// `#327` LocalHandle
///
/// calls `GlobalHandle()`
#[cfg(feature = "system-services-defaultheapmemobjs-local")]
pub use sysmem::LocalHandle;

/// `#328` GlobalLock
///
/// increment the lock count and lock the memory specified by the `hMem`
/// parameter
#[cfg(feature = "system-services-defaultheapmemobjs-global")]
pub use sysmem::GlobalLock;

/// `#328` GlobalUnlock
///
/// decrement the lock count and unlock the memory specified by the `hMem`
/// parameter
#[cfg(feature = "system-services-defaultheapmemobjs-global")]
pub use sysmem::GlobalUnlock;

/// `#328` LocalLock
///
/// increment the lock count and lock the memory specified by the `hMem`
/// parameter
#[cfg(feature = "system-services-defaultheapmemobjs-local")]
pub use sysmem::LocalLock;

/// `#328` LocalUnlock
///
/// decrement the lock count and unlock the memory specified by the `hMem`
/// parameter
#[cfg(feature = "system-services-defaultheapmemobjs-local")]
pub use sysmem::LocalUnlock;

/// `#329` GlobalLRUNewest
///
/// currently performs no operation.
///
/// orginally moves a memory segment to the newest LRU (least-recently-used)
/// position in memory
removed_item!(
    pub use sysmem::GlobalLRUNewest;
);

/// `#329` GlobalLRUOldest
///
/// currently performs no operation.
///
/// orginally moves a memory segment to the oldest LRU position in memory
removed_item!(
    pub use sysmem::GlobalLRUOldest;
);

/// `#330` GlobalNotify
///
/// sets the callback function pointed to by the `NotifyProc` parameter
removed_item!(
    pub use sysmem::GlobalNotify;
);

/// `#330` NotifyProc
///
/// a user-defined, exported callback function of type `GNOTIFYPROC`
removed_item!(
    pub type NotifyProc = extern "system" fn(winsys_foundation::HGLOBAL) -> wincore::BOOL;
);

/// `#331` GlobalReAlloc
///
/// modifies the size or other attributes in a memory segment, specified by the
/// `hMem` parameter
#[cfg(feature = "system-services-defaultheapmemobjs-global")]
pub use sysmem::GlobalReAlloc;

/// `#332` GlobalSize
///
/// return the size of the memory segment specified by the `hMem` parameter
#[cfg(feature = "system-services-defaultheapmemobjs-global")]
pub use sysmem::GlobalSize;

/// `#332` LocalSize
///
/// calls `GlobalSize()`
#[cfg(feature = "system-services-defaultheapmemobjs-local")]
pub use sysmem::LocalSize;

/// `#333` LocalInit
///
/// provided as stub functions that perform no actions
removed_item!(
    pub use sysmem::LocalInit;
);

/// `#333` LocalShrink
///
/// provided as stub functions that perform no actions
removed_item!(
    pub use sysmem::LocalShrink;
);

/// `#334` Catch
///
/// saves the current execution environment and stores it in the buffer
removed_item!(
    pub use diagdbg::Catch;
);

/// `#334` Throw
///
/// restores the execution environment from the buffer specified by the
/// `lpCatchBuf` parameter
removed_item!(
    pub use diagdbg::Throw;
);

/// `#335` Yield
///
/// pass control between multiple running tasks
removed_item!(
    pub use winmsg::Yield;
);

/// `#335` DirectedYield
///
/// pass control between multiple running tasks
removed_item!(
    pub use winmsg::DirectedYield;
);

/// `#336` GetCurrentTask
///
/// retrieves the handle of the currently running task
removed_item!(
    pub use winmsg::GetCurrentTask;
);

/// `#337` GetNumTasks
///
/// returns the number of tasks currently running in the system
removed_item!(
    pub use winmsg::GetNumTasks;
);

/// `#338` GetWindowTask
///
/// retrieves the handle of a task that created the window specified in `hWnd`
/// parameter
removed_item!(
    pub use winmsg::GetWindowTask;
);

/// `#339` IsTask
///
/// checks whether the task handle specified in `hTask` parameter is valid
removed_item!(
    pub use winmsg::IsTask;
);

/// `#340` WinHelp
///
/// invokes the Windows Help facility and optionally requests the application
/// specific help topic
#[cfg(feature = "system-services-winhelp")]
pub use shell::WinHelpW as WinHelp;

/// `C.15` HELPWININFO
///
/// contains the secondary help window's size and position information
#[cfg(feature = "system-services-winhelp")]
pub use shell::HELPWININFOW as HELPWININFO;

/// `#341` EnumTaskWindows
///
/// enumerates all windows associated with a task
removed_item!(
    pub use winmsg::EnumTaskWindows;
);

/// `#341` EnumTaskWndProc
///
/// an exported, user-defined, callback function of type `WNDENUMPROC` whose
/// address is passed to the `EnumTaskWindows()` function
removed_item!(
    pub type EnumTaskWndProc =
        extern "system" fn(winsys_foundation::HWND, winsys_foundation::LPARAM) -> wincore::BOOL;
);

/// `#342` WinExec
///
/// starts an application
#[cfg(feature = "system-services-winexec")]
pub use systhread::WinExec;

/// `#343` WinMain
#[cfg(feature = "system-services-winmain")]
pub type WinMain = extern "system" fn(
    winsys_foundation::HINSTANCE,
    winsys_foundation::HINSTANCE,
    wincore::PSTR,
    i32,
) -> i32;

/// `#344` ExitWindows
///
/// shuts down the runtime environment with an option to restart it
#[cfg(feature = "system-services-shutdown")]
pub use sysshutdown_polyfill::ExitWindows;

/// `#344a` ExitWindowsEx
///
/// shuts down the runtime environment with an option to restart it
#[cfg(feature = "system-services-shutdown")]
pub use sysshutdown::ExitWindowsEx;

/// `#345` GetAsyncKeyState
///
/// indicates, at the time the function is called, whether a particular key is
/// up or down
#[cfg(feature = "system-services-inputstate")]
pub use kbdmse::GetAsyncKeyState;

/// `#346` GetInputState
///
/// checks the system queue and identifies mouse clicks or keyboard events that
/// need to be processed
#[cfg(feature = "system-services-inputstate")]
pub use winmsg::GetInputState;

/// `#347` GetKeyboardState
///
/// copies the status of the 256 virtual-keyboard keys to the buffer
#[cfg(feature = "system-services-inputstate")]
pub use kbdmse::GetKeyboardState;

/// `#347` SetKeyboardState
///
/// copies the contents of the 256-byte array buffer pointed to by the
/// `lpKeyStateBuf` parameter into the system keyboard state table
#[cfg(feature = "system-services-inputstate")]
pub use kbdmse::SetKeyboardState;

/// `#348` GetKeyNameText
///
/// retrieves a string representing the name of the key
#[cfg(feature = "system-services-params-and-metrics")]
pub use kbdmse::GetKeyNameTextW as GetKeyNameText;

/// `#349` GetKeyState
///
/// obtains the state of the virtual key identified by the `vidkey` parameter
#[cfg(feature = "system-services-inputstate")]
pub use kbdmse::GetKeyState;

/// `#350` GetKBCodePage
///
/// returns the current system code page
#[cfg(feature = "system-services-params-and-metrics")]
pub use kbdmse::GetKBCodePage;

/// `#351` OemKeyScan
///
/// converts OEM ASCII codes 0 through 0xFF to their corresponding OEM scan
/// codes and shift states
#[cfg(feature = "system-services-inputstate")]
pub use kbdmse::OemKeyScan;

/// `#352` MapVirtualKey
///
/// converts the virtual-key code identified by the idKeyCode parameter to the
/// scan code or ASCII value, or vice-versa
#[cfg(feature = "system-services-inputstate")]
pub use kbdmse::MapVirtualKeyW as MapVirtualKey;

/// `#353` VkKeyScan
///
/// converts a system character to a virtual-key code and shift state for the
/// keyboard
#[cfg(feature = "system-services-inputstate")]
pub use kbdmse::VkKeyScanW as VkKeyScan;

/// `#354` SwapMouseButton
///
/// sets the meaning of the right and left mouse buttons
#[cfg(feature = "system-services-params-and-metrics")]
pub use kbdmse::SwapMouseButton;

/// `#355` GetKeyboardType
///
/// fetches the requested information about the keyboard that is currently in
/// use
#[cfg(feature = "system-services-params-and-metrics")]
pub use kbdmse::GetKeyboardType;

/// `#356` FindResource
///
/// returns a handle to a resource in a module
#[cfg(feature = "system-services-resource")]
pub use libloader::FindResourceW as FindResource;

/// `#357` LoadResource
///
/// loads a resource into global memory and returns a handle to the memory
#[cfg(feature = "system-services-resource")]
pub use libloader::LoadResource;

/// `#357` FreeResource
///
/// frees a resource previously loaded by the `LoadResource()` function
#[cfg(feature = "system-services-resource")]
pub use libloader::FreeResource;

/// `#358` LockResource
///
/// locks a resource that has been loaded into global memory and returns a
/// pointer to the resource's data
#[cfg(feature = "system-services-resource")]
pub use libloader::LockResource;

/// `#359` LoadString
///
/// loads a string resource into a given buffer
#[cfg(feature = "system-services-resource")]
pub use winmsg::LoadStringW;

/// `#360` LoadIcon
///
/// loads an icon resource from a module or one of the predefined system icons
#[cfg(feature = "system-services-resource")]
pub use winmsg::LoadIconW as LoadIcon;

/// `#361` LoadBitmap
///
/// loads a bitmap resource from a module or one of the predefined system
/// bitmaps
#[cfg(feature = "system-services-resource")]
pub use gdi::LoadBitmapW as LoadBitmap;

/// `#362` SetResourceHandler
///
/// install a callback function that loads resources
removed_item!(
    pub use winmsg::SetResourceHandler;
);

/// `#362` LoadProc
///
/// a user-defined callback function receives information about a resource to be
/// locked
removed_item!(
    pub type LoadProc = extern "system" fn(
        winsys_foundation::HGLOBAL,
        winsys_foundation::HINSTANCE,
        winsys_foundation::HRSRC,
    ) -> winsys_foundation::HGLOBAL;
);

/// `#363` SizeofResource
///
/// determines the size of a resource in bytes
#[cfg(feature = "system-services-resource")]
pub use libloader::SizeofResource;

/// `#364` LoadMenu
///
/// loads an menu resource from a module
#[cfg(feature = "system-services-resource")]
pub use winmsg::LoadMenuW as LoadMenu;

/// `#365` LoadMenuIndirect
///
/// creates a menu resource from the information supplied to the function
#[cfg(feature = "system-services-resource")]
pub use winmsg::LoadMenuIndirectW as LoadMenuIndirect;

/// `C.22` MENUITEMTEMPLATE
///
/// contains information about a menu item
#[cfg(feature = "system-services-resource")]
pub use winmsg::MENUITEMTEMPLATE;

/// `C.23` MENUITEMTEMPLATEHEADER
///
/// contains the header information for a menu-item list
#[cfg(feature = "system-services-resource")]
pub use winmsg::MENUITEMTEMPLATEHEADER;

/// `#366` LoadAccelerators
///
/// loads an accelerator table into memory and returns a handle to the
/// accelerator table
#[cfg(feature = "system-services-resource")]
pub use winmsg::LoadAcceleratorsW as LoadAccelerators;

/// `#367` AllocResource
///
/// allocates uninitialized memory for the resource specified by the `hrsrc`
/// parameter
removed_item!(
    pub use winmsg::AllocResource;
);

/// `#368` BuildCommDCB
///
/// converts the given device-definition control string into the appropriate
/// serial device control block codes
#[cfg(feature = "system-services-comm")]
pub use comm::BuildCommDCBW as BuildCommDCB;

/// `#369` ClearCommBreak
///
/// returns the communications-device to nonbreak state and permits character
/// transmission to take place
#[cfg(feature = "system-services-comm")]
pub use comm::ClearCommBreak;

/// `#369` SetCommBreak
///
/// puts the communication device specified by `NumComDev` in break state
#[cfg(feature = "system-services-comm")]
pub use comm::SetCommBreak;

/// `#370` CloseComm
///
/// closes the communications device identified by `NumComDev` making sure that
/// the output queue is empty
removed_item!(
    pub use comm::CloseComm;
);

/// `#370` OpenComm
///
/// open the communication device
removed_item!(
    pub use comm::OpenComm;
);

/// `#371` EnableCommNotification
///
/// toggles the state (Enable/Disable) of the WM_COMMNOTIFY message that is
/// posted to the given window
removed_item!(
    pub use comm::EnableCommNotification;
);

/// `#372` EscapeCommFunction
///
/// requests the specified communication device to carry an extended function
#[cfg(feature = "system-services-comm")]
pub use comm::EscapeCommFunction;

/// `#373` FlushComm
///
/// flushes all characters from either the transmission or receiving queue of
/// the device identified by the `NumComDev` parameter
removed_item!(
    pub use comm::FlushComm;
);

/// `#374` GetCommError
///
/// returns the most recent error value for the communication device specified
/// by the `NumComDev` parameter
removed_item!(
    pub use comm::GetCommError;
);

/// `#375` GetCommEventMask
///
/// clears the event word of a communications device after retrieving this value
removed_item!(
    pub use comm::GetCommEventMask;
);

/// `#375` SetCommEventMask
///
/// enables the event word of the specified communications device
removed_item!(
    pub use comm::SetCommEventMask;
);

/// `#376` GetCommState
///
/// gets the device control block for the device identified by the `NumComDev`
/// parameter
#[cfg(feature = "system-services-comm")]
pub use comm::GetCommState;

/// `#376` SetCommState
///
/// set the communications device to the state specified by the settings in the
/// DCB structure
#[cfg(feature = "system-services-comm")]
pub use comm::SetCommState;

/// `#377` ReadComm
///
/// reads up to an indicated number of bytes from the communication device
/// specified by the `NumComDev` parameter
removed_item!(
    pub use comm::ReadComm;
);

/// `#377` WriteComm
///
/// writes up to an indicated number of bytes to the communication device
/// specified by the `NumComDev` parameter
removed_item!(
    pub use comm::WriteComm;
);

/// `#378` TransmitCommChar
///
/// puts the specified character contained in the `TransCh` parameter at the
/// head of the transmission queue of the device identified by the `NumComDev`
/// parameter
#[cfg(feature = "system-services-comm")]
pub use comm::TransmitCommChar;

/// `#378` UngetCommChar
///
/// puts the specified character contained in `UngetCh` back in the receiving
/// queue of the device identified by the `NumComDev` parameter
removed_item!(
    pub use comm::UngetCommChar;
);

/// `#379` GetDriveType
///
/// reports whether the `drive` specified in the DriveNumber parameter is
/// removable, fixed, or remote
#[cfg(feature = "system-services-drivetype")]
pub use storefs::GetDriveTypeW as GetDriveType;

/// `#380` GetSystemDirectory
///
/// retrieves the system directory that contains drivers, libraries, font files,
/// and so on.
#[cfg(feature = "system-services-syspathname")]
pub use sysinfo::GetSystemDirectoryW as GetSystemDirectory;

/// `#381` GetTempDrive
///
/// returns a drive letter that can be used as temporary space
removed_item!(
    pub use storefs::GetTempDrive;
);

/// `#382` GetTempFileName
///
/// creates a file name that can be used for temporary storage
#[cfg(feature = "system-services-syspathname")]
pub use storefs::GetTempFileNameW as GetTempFileName;

/// `#383` GetWindowsDirectory
///
/// returns the path to the system directory, which contains the application's
/// .INI files, temporary files, and so on.
#[cfg(feature = "system-services-syspathname")]
pub use sysinfo::GetWindowsDirectoryW as GetWindowsDirectory;

/// `#384` OpenFile
///
/// creates, opens, reopens, or deletes a file
#[cfg(feature = "system-services-fileop-deprecated")]
#[deprecated]
pub use storefs::OpenFile;

/// `C.27` OFSTRUCT
///
/// contains information about an open file
#[cfg(feature = "system-services-fileop-deprecated")]
#[deprecated]
pub use storefs::OFSTRUCT;

/// `#385` SetHandleCount
///
/// sets the number of file handles available to an application
#[cfg(feature = "system-services-fileop-deprecated")]
#[deprecated]
pub use winprg::SetHandleCount;

/// `#386` _lclose
///
/// closes the file described by the file handle
#[cfg(feature = "system-services-fileop-deprecated")]
#[deprecated]
pub use winprg::_lclose;

/// `#387` _lread
///
/// reads a specified number of bytes from a file into memory
#[cfg(feature = "system-services-fileop-deprecated")]
#[deprecated]
pub use winprg::_lread;

/// `#388` _lcreat
///
/// opens a file, described by `FileName`, for reading and/or writing
#[cfg(feature = "system-services-fileop-deprecated")]
#[deprecated]
pub use winprg::_lcreat;

/// `#389` _llseek
///
/// moves the current file position pointer of the file described by
/// `FileHandle` (of type HFILE), an offset of `OffsetFromCurrent` from the
/// position described by `StartPos()`
#[cfg(feature = "system-services-fileop-deprecated")]
#[deprecated]
pub use winprg::_llseek;

/// `#390` _lopen
///
/// open up a file as described by `FileName`, with the open options as
/// described by `FileMode`.
#[cfg(feature = "system-services-fileop-deprecated")]
#[deprecated]
pub use winprg::_lopen;

/// `#391` _lwrite
///
/// writes a specified number of bytes of memory to a file
#[cfg(feature = "system-services-fileop-deprecated")]
#[deprecated]
pub use winprg::_lwrite;

/// `#392` RegCloseKey
///
/// releases the handle of the key specified by the `hkey` parameter by closing
/// the key
#[cfg(feature = "system-services-regop")]
pub use sysreg::RegCloseKey;

/// `#393` RegCreateKey
///
/// either creates a Registration Database key or opens the specified key if it
/// already exists
#[cfg(feature = "system-services-regop")]
pub use sysreg::RegCreateKeyW as RegCreateKey;

/// `#393` RegOpenKey
///
/// opens a Registration Database key
#[cfg(feature = "system-services-regop")]
pub use sysreg::RegOpenKeyW as RegOpenKey;

/// `#394` RegDeleteKey
///
/// deletes the Registration Database subkey specified by the `szSubKey`
/// parameter
#[cfg(feature = "system-services-regop")]
pub use sysreg::RegDeleteKeyW as RegDeleteKey;

/// `#395` RegEnumKey
///
/// enumerates the subkeys of the Registration Database entry specified by the
/// `hkey` parameter, an open handle (which can be HKEY_CLASSES_ROOT)
#[cfg(feature = "system-services-regop")]
pub use sysreg::RegEnumKeyW as RegEnumKey;

/// `#396` RegQueryValue
///
/// queries the Registration Database and returns the value of `szSubKey`
#[cfg(feature = "system-services-regop")]
pub use sysreg::RegQueryValueW as RegQueryValue;

/// `#396` RegSetValue
///
/// sets the subkey specified by `szSubKey` to a value stored in `szValue`
#[cfg(feature = "system-services-regop")]
pub use sysreg::RegSetValueW as RegSetValue;

/// `#397` IsBadCodePtr
///
/// validates the given pointer to executable code
#[cfg(feature = "system-services-ptrvalidate")]
pub use sysmem::IsBadCodePtr;

/// `#398` IsBadHugeReadPtr
///
/// determines whether a huge pointer to readable memory is valid
removed_item!(
    pub use sysmem::IsBadHugeReadPtr;
);

/// `#399` IsBadHugeWritePtr
///
/// validates the given huge pointer to a writable memory block
removed_item!(
    pub use sysmem::IsBadHugeWritePtr;
);

/// `#400` IsBadReadPtr
///
/// validates the given pointer to readable memory
#[cfg(feature = "system-services-ptrvalidate")]
pub use sysmem::IsBadReadPtr;

/// `#401` IsBadStringPtr
///
/// validates the given pointer to a string
#[cfg(feature = "system-services-ptrvalidate")]
pub use sysmem::IsBadStringPtrW as IsBadStringPtr;

/// `#402` IsBadWritePtr
///
/// validates a given pointer to writable memory
#[cfg(feature = "system-services-ptrvalidate")]
pub use sysmem::IsBadWritePtr;

#[cfg(feature = "system-services-shutdown")]
mod sysshutdown_polyfill {
    #![allow(non_snake_case, missing_docs)]
    #![allow(clippy::missing_safety_doc)]
    use super::sysshutdown;
    use super::wincore;

    #[inline]
    pub unsafe extern "system" fn ExitWindows(_dwreserved: u32, _code: u32) -> wincore::BOOL {
        unsafe { sysshutdown::ExitWindowsEx(sysshutdown::EWX_LOGOFF, u32::MAX) }
    }
}