@@ -441,7 +441,7 @@ _winapi_ConnectNamedPipe_impl(PyObject *module, HANDLE handle,
441441/*[clinic input]
442442_winapi.CreateFile -> HANDLE
443443
444- file_name: LPCTSTR
444+ file_name: LPCWSTR
445445 desired_access: DWORD
446446 share_mode: DWORD
447447 security_attributes: LPSECURITY_ATTRIBUTES
@@ -452,12 +452,12 @@ _winapi.CreateFile -> HANDLE
452452[clinic start generated code]*/
453453
454454static HANDLE
455- _winapi_CreateFile_impl (PyObject * module , LPCTSTR file_name ,
455+ _winapi_CreateFile_impl (PyObject * module , LPCWSTR file_name ,
456456 DWORD desired_access , DWORD share_mode ,
457457 LPSECURITY_ATTRIBUTES security_attributes ,
458458 DWORD creation_disposition ,
459459 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 ]*/
461461{
462462 HANDLE handle ;
463463
@@ -468,14 +468,15 @@ _winapi_CreateFile_impl(PyObject *module, LPCTSTR file_name,
468468 }
469469
470470 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 );
475475 Py_END_ALLOW_THREADS
476476
477- if (handle == INVALID_HANDLE_VALUE )
477+ if (handle == INVALID_HANDLE_VALUE ) {
478478 PyErr_SetFromWindowsErr (0 );
479+ }
479480
480481 return handle ;
481482}
0 commit comments