static BOOL get_unix_path(ANSI_STRING *unix_name, const char *filename) { UNICODE_STRING dospathW, ntpathW; ANSI_STRING dospath; NTSTATUS status; RtlInitAnsiString(&dospath, filename); if (RtlAnsiStringToUnicodeString(&dospathW, &dospath, TRUE)) return FALSE; if (!RtlDosPathNameToNtPathName_U(dospathW.Buffer, &ntpathW, NULL, NULL)) { RtlFreeUnicodeString(&dospathW); return FALSE; } status = wine_nt_to_unix_file_name(&ntpathW, unix_name, FILE_OPEN, FALSE); RtlFreeUnicodeString(&ntpathW); RtlFreeUnicodeString(&dospathW); return !status; } Usage: ANSI_STRING unix_name; if (!get_unix_path(&unix_name, pszFileName)) return ... // handle error // unix_name.Buffer contains unix path RtlFreeAnsiString(&unix_name);