@@ -256,10 +256,6 @@ pub const WAIT_OBJECT_0: DWORD = 0x00000000;
256256pub const WAIT_TIMEOUT : DWORD = 258 ;
257257pub const WAIT_FAILED : DWORD = 0xFFFFFFFF ;
258258
259- pub const EXCEPTION_CONTINUE_SEARCH : LONG = 0 ;
260- pub const EXCEPTION_STACK_OVERFLOW : DWORD = 0xc00000fd ;
261- pub const EXCEPTION_MAXIMUM_PARAMETERS : usize = 15 ;
262-
263259pub const PIPE_ACCESS_INBOUND : DWORD = 0x00000001 ;
264260pub const PIPE_ACCESS_OUTBOUND : DWORD = 0x00000002 ;
265261pub const FILE_FLAG_FIRST_PIPE_INSTANCE : DWORD = 0x00080000 ;
@@ -444,25 +440,6 @@ pub struct REPARSE_MOUNTPOINT_DATA_BUFFER {
444440 pub ReparseTarget : WCHAR ,
445441}
446442
447- #[ repr( C ) ]
448- pub struct EXCEPTION_RECORD {
449- pub ExceptionCode : DWORD ,
450- pub ExceptionFlags : DWORD ,
451- pub ExceptionRecord : * mut EXCEPTION_RECORD ,
452- pub ExceptionAddress : LPVOID ,
453- pub NumberParameters : DWORD ,
454- pub ExceptionInformation : [ LPVOID ; EXCEPTION_MAXIMUM_PARAMETERS ]
455- }
456-
457- #[ repr( C ) ]
458- pub struct EXCEPTION_POINTERS {
459- pub ExceptionRecord : * mut EXCEPTION_RECORD ,
460- pub ContextRecord : * mut CONTEXT ,
461- }
462-
463- pub type PVECTORED_EXCEPTION_HANDLER = extern "system"
464- fn ( ExceptionInfo : * mut EXCEPTION_POINTERS ) -> LONG ;
465-
466443#[ repr( C ) ]
467444pub struct GUID {
468445 pub Data1 : DWORD ,
@@ -545,8 +522,6 @@ pub enum ADDRESS_MODE {
545522 AddrModeFlat ,
546523}
547524
548- pub enum CONTEXT { }
549-
550525#[ repr( C ) ]
551526pub struct SOCKADDR_STORAGE_LH {
552527 pub ss_family : ADDRESS_FAMILY ,
@@ -631,6 +606,31 @@ pub struct timeval {
631606// Functions forbidden when targeting UWP
632607cfg_if:: cfg_if! {
633608if #[ cfg( not( target_vendor = "uwp" ) ) ] {
609+ pub const EXCEPTION_CONTINUE_SEARCH : LONG = 0 ;
610+ pub const EXCEPTION_STACK_OVERFLOW : DWORD = 0xc00000fd ;
611+ pub const EXCEPTION_MAXIMUM_PARAMETERS : usize = 15 ;
612+
613+ #[ repr( C ) ]
614+ pub struct EXCEPTION_RECORD {
615+ pub ExceptionCode : DWORD ,
616+ pub ExceptionFlags : DWORD ,
617+ pub ExceptionRecord : * mut EXCEPTION_RECORD ,
618+ pub ExceptionAddress : LPVOID ,
619+ pub NumberParameters : DWORD ,
620+ pub ExceptionInformation : [ LPVOID ; EXCEPTION_MAXIMUM_PARAMETERS ]
621+ }
622+
623+ pub enum CONTEXT { }
624+
625+ #[ repr( C ) ]
626+ pub struct EXCEPTION_POINTERS {
627+ pub ExceptionRecord : * mut EXCEPTION_RECORD ,
628+ pub ContextRecord : * mut CONTEXT ,
629+ }
630+
631+ pub type PVECTORED_EXCEPTION_HANDLER = extern "system"
632+ fn ( ExceptionInfo : * mut EXCEPTION_POINTERS ) -> LONG ;
633+
634634 #[ repr( C ) ]
635635 #[ derive( Copy , Clone ) ]
636636 pub struct CONSOLE_READCONSOLE_CONTROL {
@@ -694,6 +694,9 @@ if #[cfg(not(target_vendor = "uwp"))] {
694694 pub fn SetHandleInformation ( hObject: HANDLE ,
695695 dwMask: DWORD ,
696696 dwFlags: DWORD ) -> BOOL ;
697+ pub fn AddVectoredExceptionHandler ( FirstHandler : ULONG ,
698+ VectoredHandler : PVECTORED_EXCEPTION_HANDLER )
699+ -> LPVOID ;
697700 pub fn CreateHardLinkW ( lpSymlinkFileName: LPCWSTR ,
698701 lpTargetFileName: LPCWSTR ,
699702 lpSecurityAttributes: LPSECURITY_ATTRIBUTES )
@@ -804,9 +807,6 @@ extern "system" {
804807 lpData : LPVOID ,
805808 pbCancel : LPBOOL ,
806809 dwCopyFlags : DWORD ) -> BOOL ;
807- pub fn AddVectoredExceptionHandler ( FirstHandler : ULONG ,
808- VectoredHandler : PVECTORED_EXCEPTION_HANDLER )
809- -> LPVOID ;
810810 pub fn FormatMessageW ( flags : DWORD ,
811811 lpSrc : LPVOID ,
812812 msgId : DWORD ,
@@ -1015,6 +1015,7 @@ compat_fn! {
10151015 _dwFlags: DWORD ) -> DWORD {
10161016 SetLastError ( ERROR_CALL_NOT_IMPLEMENTED as DWORD ) ; 0
10171017 }
1018+ #[ cfg( not( target_vendor = "uwp" ) ) ]
10181019 pub fn SetThreadStackGuarantee ( _size: * mut c_ulong) -> BOOL {
10191020 SetLastError ( ERROR_CALL_NOT_IMPLEMENTED as DWORD ) ; 0
10201021 }
0 commit comments