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