@@ -439,7 +439,7 @@ _winapi_ConnectNamedPipe_impl(PyObject *module, HANDLE handle,
439439/*[clinic input]
440440_winapi.CreateFile -> HANDLE
441441
442- file_name: LPCTSTR
442+ file_name: LPCWSTR
443443 desired_access: DWORD
444444 share_mode: DWORD
445445 security_attributes: LPSECURITY_ATTRIBUTES
@@ -450,12 +450,12 @@ _winapi.CreateFile -> HANDLE
450450[clinic start generated code]*/
451451
452452static HANDLE
453- _winapi_CreateFile_impl (PyObject * module , LPCTSTR file_name ,
453+ _winapi_CreateFile_impl (PyObject * module , LPCWSTR file_name ,
454454 DWORD desired_access , DWORD share_mode ,
455455 LPSECURITY_ATTRIBUTES security_attributes ,
456456 DWORD creation_disposition ,
457457 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 ]*/
459459{
460460 HANDLE handle ;
461461
@@ -466,14 +466,15 @@ _winapi_CreateFile_impl(PyObject *module, LPCTSTR file_name,
466466 }
467467
468468 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 );
473473 Py_END_ALLOW_THREADS
474474
475- if (handle == INVALID_HANDLE_VALUE )
475+ if (handle == INVALID_HANDLE_VALUE ) {
476476 PyErr_SetFromWindowsErr (0 );
477+ }
477478
478479 return handle ;
479480}
0 commit comments