@@ -441,7 +441,7 @@ _winapi_ConnectNamedPipe_impl(PyObject *module, HANDLE handle,
441
441
/*[clinic input]
442
442
_winapi.CreateFile -> HANDLE
443
443
444
- file_name: LPCTSTR
444
+ file_name: LPCWSTR
445
445
desired_access: DWORD
446
446
share_mode: DWORD
447
447
security_attributes: LPSECURITY_ATTRIBUTES
@@ -452,12 +452,12 @@ _winapi.CreateFile -> HANDLE
452
452
[clinic start generated code]*/
453
453
454
454
static HANDLE
455
- _winapi_CreateFile_impl (PyObject * module , LPCTSTR file_name ,
455
+ _winapi_CreateFile_impl (PyObject * module , LPCWSTR file_name ,
456
456
DWORD desired_access , DWORD share_mode ,
457
457
LPSECURITY_ATTRIBUTES security_attributes ,
458
458
DWORD creation_disposition ,
459
459
DWORD flags_and_attributes , HANDLE template_file )
460
- /*[clinic end generated code: output=417ddcebfc5a3d53 input=6423c3e40372dbd5 ]*/
460
+ /*[clinic end generated code: output=818c811e5e04d550 input=1fa870ed1c2e3d69 ]*/
461
461
{
462
462
HANDLE handle ;
463
463
@@ -468,14 +468,15 @@ _winapi_CreateFile_impl(PyObject *module, LPCTSTR file_name,
468
468
}
469
469
470
470
Py_BEGIN_ALLOW_THREADS
471
- handle = CreateFile (file_name , desired_access ,
472
- share_mode , security_attributes ,
473
- creation_disposition ,
474
- flags_and_attributes , template_file );
471
+ handle = CreateFileW (file_name , desired_access ,
472
+ share_mode , security_attributes ,
473
+ creation_disposition ,
474
+ flags_and_attributes , template_file );
475
475
Py_END_ALLOW_THREADS
476
476
477
- if (handle == INVALID_HANDLE_VALUE )
477
+ if (handle == INVALID_HANDLE_VALUE ) {
478
478
PyErr_SetFromWindowsErr (0 );
479
+ }
479
480
480
481
return handle ;
481
482
}
0 commit comments