@@ -19,7 +19,7 @@ mod _winapi {
1919 Win32 :: Foundation :: { HANDLE , HINSTANCE , MAX_PATH } ,
2020 core:: PCWSTR ,
2121 } ;
22- use windows_sys:: Win32 :: Foundation :: { BOOL , INVALID_HANDLE_VALUE } ;
22+ use windows_sys:: Win32 :: Foundation :: INVALID_HANDLE_VALUE ;
2323
2424 #[ pyattr]
2525 use windows_sys:: Win32 :: {
@@ -36,14 +36,19 @@ mod _winapi {
3636 LCMAP_TRADITIONAL_CHINESE , LCMAP_UPPERCASE ,
3737 } ,
3838 Storage :: FileSystem :: {
39- COPYFILE2_CALLBACK_CHUNK_FINISHED , COPYFILE2_CALLBACK_CHUNK_STARTED ,
40- COPYFILE2_CALLBACK_ERROR , COPYFILE2_CALLBACK_POLL_CONTINUE ,
41- COPYFILE2_CALLBACK_STREAM_FINISHED , COPYFILE2_CALLBACK_STREAM_STARTED ,
42- COPYFILE2_PROGRESS_CANCEL , COPYFILE2_PROGRESS_CONTINUE , COPYFILE2_PROGRESS_PAUSE ,
43- COPYFILE2_PROGRESS_QUIET , COPYFILE2_PROGRESS_STOP , FILE_FLAG_FIRST_PIPE_INSTANCE ,
44- FILE_FLAG_OVERLAPPED , FILE_GENERIC_READ , FILE_GENERIC_WRITE , FILE_TYPE_CHAR ,
45- FILE_TYPE_DISK , FILE_TYPE_PIPE , FILE_TYPE_REMOTE , FILE_TYPE_UNKNOWN , OPEN_EXISTING ,
46- PIPE_ACCESS_DUPLEX , PIPE_ACCESS_INBOUND , SYNCHRONIZE ,
39+ COPY_FILE_ALLOW_DECRYPTED_DESTINATION , COPY_FILE_COPY_SYMLINK ,
40+ COPY_FILE_FAIL_IF_EXISTS , COPY_FILE_NO_BUFFERING , COPY_FILE_NO_OFFLOAD ,
41+ COPY_FILE_OPEN_SOURCE_FOR_WRITE , COPY_FILE_REQUEST_COMPRESSED_TRAFFIC ,
42+ COPY_FILE_REQUEST_SECURITY_PRIVILEGES , COPY_FILE_RESTARTABLE ,
43+ COPY_FILE_RESUME_FROM_PAUSE , COPYFILE2_CALLBACK_CHUNK_FINISHED ,
44+ COPYFILE2_CALLBACK_CHUNK_STARTED , COPYFILE2_CALLBACK_ERROR ,
45+ COPYFILE2_CALLBACK_POLL_CONTINUE , COPYFILE2_CALLBACK_STREAM_FINISHED ,
46+ COPYFILE2_CALLBACK_STREAM_STARTED , COPYFILE2_PROGRESS_CANCEL ,
47+ COPYFILE2_PROGRESS_CONTINUE , COPYFILE2_PROGRESS_PAUSE , COPYFILE2_PROGRESS_QUIET ,
48+ COPYFILE2_PROGRESS_STOP , FILE_FLAG_FIRST_PIPE_INSTANCE , FILE_FLAG_OVERLAPPED ,
49+ FILE_GENERIC_READ , FILE_GENERIC_WRITE , FILE_TYPE_CHAR , FILE_TYPE_DISK , FILE_TYPE_PIPE ,
50+ FILE_TYPE_REMOTE , FILE_TYPE_UNKNOWN , OPEN_EXISTING , PIPE_ACCESS_DUPLEX ,
51+ PIPE_ACCESS_INBOUND , SYNCHRONIZE ,
4752 } ,
4853 System :: {
4954 Console :: { STD_ERROR_HANDLE , STD_INPUT_HANDLE , STD_OUTPUT_HANDLE } ,
@@ -65,13 +70,6 @@ mod _winapi {
6570 IDLE_PRIORITY_CLASS , INFINITE , NORMAL_PRIORITY_CLASS , PROCESS_DUP_HANDLE ,
6671 REALTIME_PRIORITY_CLASS , STARTF_USESHOWWINDOW , STARTF_USESTDHANDLES ,
6772 } ,
68- WindowsProgramming :: {
69- COPY_FILE_ALLOW_DECRYPTED_DESTINATION , COPY_FILE_COPY_SYMLINK ,
70- COPY_FILE_FAIL_IF_EXISTS , COPY_FILE_NO_BUFFERING , COPY_FILE_NO_OFFLOAD ,
71- COPY_FILE_OPEN_SOURCE_FOR_WRITE , COPY_FILE_REQUEST_COMPRESSED_TRAFFIC ,
72- COPY_FILE_REQUEST_SECURITY_PRIVILEGES , COPY_FILE_RESTARTABLE ,
73- COPY_FILE_RESUME_FROM_PAUSE ,
74- } ,
7573 } ,
7674 UI :: WindowsAndMessaging :: SW_HIDE ,
7775 } ;
@@ -80,7 +78,7 @@ mod _winapi {
8078 const NULL : isize = 0 ;
8179
8280 #[ pyfunction]
83- fn CloseHandle ( handle : HANDLE ) -> WindowsSysResult < BOOL > {
81+ fn CloseHandle ( handle : HANDLE ) -> WindowsSysResult < i32 > {
8482 WindowsSysResult ( unsafe { windows_sys:: Win32 :: Foundation :: CloseHandle ( handle. 0 as _ ) } )
8583 }
8684
@@ -128,7 +126,7 @@ mod _winapi {
128126 src : HANDLE ,
129127 target_process : HANDLE ,
130128 access : u32 ,
131- inherit : BOOL ,
129+ inherit : i32 ,
132130 options : OptionalArg < u32 > ,
133131 vm : & VirtualMachine ,
134132 ) -> PyResult < HANDLE > {
@@ -299,7 +297,7 @@ mod _winapi {
299297 unsafe {
300298 windows_sys:: Win32 :: System :: Threading :: OpenProcess (
301299 desired_access,
302- BOOL :: from ( inherit_handle) ,
300+ i32 :: from ( inherit_handle) ,
303301 process_id,
304302 ) as _
305303 }
@@ -473,7 +471,7 @@ mod _winapi {
473471 }
474472
475473 #[ pyfunction]
476- fn TerminateProcess ( h : HANDLE , exit_code : u32 ) -> WindowsSysResult < BOOL > {
474+ fn TerminateProcess ( h : HANDLE , exit_code : u32 ) -> WindowsSysResult < i32 > {
477475 WindowsSysResult ( unsafe {
478476 windows_sys:: Win32 :: System :: Threading :: TerminateProcess ( h. 0 as _ , exit_code)
479477 } )
@@ -513,7 +511,7 @@ mod _winapi {
513511 let handle = unsafe {
514512 windows_sys:: Win32 :: System :: Threading :: OpenMutexW (
515513 desired_access,
516- BOOL :: from ( inherit_handle) ,
514+ i32 :: from ( inherit_handle) ,
517515 windows_sys:: core:: PCWSTR :: from ( name as _ ) ,
518516 )
519517 } ;
@@ -524,7 +522,7 @@ mod _winapi {
524522 }
525523
526524 #[ pyfunction]
527- fn ReleaseMutex ( handle : isize ) -> WindowsSysResult < BOOL > {
525+ fn ReleaseMutex ( handle : isize ) -> WindowsSysResult < i32 > {
528526 WindowsSysResult ( unsafe {
529527 windows_sys:: Win32 :: System :: Threading :: ReleaseMutex ( handle as _ )
530528 } )
0 commit comments