@@ -451,7 +451,7 @@ _winapi_ConnectNamedPipe_impl(PyObject *module, HANDLE handle,
451
451
/*[clinic input]
452
452
_winapi.CreateFile -> HANDLE
453
453
454
- file_name: LPCTSTR
454
+ file_name: LPCWSTR
455
455
desired_access: DWORD
456
456
share_mode: DWORD
457
457
security_attributes: LPSECURITY_ATTRIBUTES
@@ -462,12 +462,12 @@ _winapi.CreateFile -> HANDLE
462
462
[clinic start generated code]*/
463
463
464
464
static HANDLE
465
- _winapi_CreateFile_impl (PyObject * module , LPCTSTR file_name ,
465
+ _winapi_CreateFile_impl (PyObject * module , LPCWSTR file_name ,
466
466
DWORD desired_access , DWORD share_mode ,
467
467
LPSECURITY_ATTRIBUTES security_attributes ,
468
468
DWORD creation_disposition ,
469
469
DWORD
E2DC
flags_and_attributes , HANDLE template_file )
470
- /*[clinic end generated code: output=417ddcebfc5a3d53 input=6423c3e40372dbd5 ]*/
470
+ /*[clinic end generated code: output=818c811e5e04d550 input=1fa870ed1c2e3d69 ]*/
471
471
{
472
472
HANDLE handle ;
473
473
@@ -478,14 +478,15 @@ _winapi_CreateFile_impl(PyObject *module, LPCTSTR file_name,
478
478
}
479
479
480
480
Py_BEGIN_ALLOW_THREADS
481
- handle = CreateFile (file_name , desired_access ,
482
- share_mode , security_attributes ,
483
- creation_disposition ,
484
- flags_and_attributes , template_file );
481
+ handle = CreateFileW (file_name , desired_access ,
482
+ share_mode , security_attributes ,
483
+ creation_disposition ,
484
+ flags_and_attributes , template_file );
485
485
Py_END_ALLOW_THREADS
486
486
487
- if (handle == INVALID_HANDLE_VALUE )
487
+ if (handle == INVALID_HANDLE_VALUE ) {
488
488
PyErr_SetFromWindowsErr (0 );
489
+ }
489
490
490
491
return handle ;
491
492
}
0 commit comments