#include <k32.h>
#include <debug.h>
Go to the source code of this file.
|
PWCHAR | FilenameA2W (LPCSTR NameA, BOOL alloc) |
|
DWORD | FilenameU2A_FitOrFail (LPSTR DestA, INT destLen, PUNICODE_STRING SourceU) |
|
DWORD | FilenameW2A_FitOrFail (LPSTR DestA, INT destLen, LPCWSTR SourceW, INT sourceLen) |
|
DWORD | FilenameA2W_N (LPWSTR dest, INT destlen, LPCSTR src, INT srclen) |
|
DWORD | FilenameW2A_N (LPSTR dest, INT destlen, LPCWSTR src, INT srclen) |
|
◆ NDEBUG
◆ FilenameA2W()
Definition at line 18 of file fileutils.c.
19{
24
25
27
30
33 else
35
38
41 else
43
45}
#define NT_SUCCESS(StatCode)
NTSYSAPI NTSTATUS NTAPI RtlOemStringToUnicodeString(PUNICODE_STRING DestinationString, PCOEM_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
DWORD BaseSetLastNTError(IN NTSTATUS Status)
#define STATUS_BUFFER_OVERFLOW
BOOL WINAPI AreFileApisANSI(void)
#define ERROR_FILENAME_EXCED_RANGE
Referenced by CreateFileA(), CreateSymbolicLinkA(), GetCompressedFileSizeA(), GetFileAttributesA(), GetFileAttributesExA(), SetFileAttributesA(), and SetFileShortNameA().
◆ FilenameA2W_N()
Definition at line 121 of file fileutils.c.
127{
129
131
134 else
136
138
140}
ACPI_SIZE strlen(const char *String)
static DWORD LPDWORD LPCSTR DWORD srclen
_Use_decl_annotations_ NTSTATUS NTAPI RtlMultiByteToUnicodeN(_Out_ PWCH UnicodeString, _In_ ULONG UnicodeSize, _Out_opt_ PULONG ResultSize, _In_ PCCH MbString, _In_ ULONG MbSize)
_Use_decl_annotations_ NTSTATUS NTAPI RtlOemToUnicodeN(_Out_ PWCHAR UnicodeString, _In_ ULONG UnicodeSize, _Out_opt_ PULONG ResultSize, _In_ PCCH OemString, _In_ ULONG OemSize)
◆ FilenameU2A_FitOrFail()
Definition at line 56 of file fileutils.c.
61{
63
64
66
68
69
70 if (DestA && (
INT)
ret <= destLen)
71 {
73
76
77
80 else
82
84 }
85
87}
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
#define RtlUnicodeStringToOemSize(STRING)
#define RtlUnicodeStringToAnsiSize(String)
Referenced by FilenameW2A_FitOrFail(), and GetFinalPathNameByHandleA().
◆ FilenameW2A_FitOrFail()
Definition at line 98 of file fileutils.c.
104{
106
107 if (sourceLen < 0) sourceLen =
wcslen(SourceW) + 1;
108
110 strW.MaximumLength = sourceLen *
sizeof(
WCHAR);
112
114}
DWORD FilenameU2A_FitOrFail(LPSTR DestA, INT destLen, PUNICODE_STRING SourceU)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
Referenced by GetTempPathA().
◆ FilenameW2A_N()
Definition at line 146 of file fileutils.c.
152{
154
156
159 else
161
163
165}
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToOemN(_Out_ PCHAR OemString, _In_ ULONG OemSize, _Out_opt_ PULONG ResultSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteN(_Out_ PCHAR MbString, _In_ ULONG MbSize, _Out_opt_ PULONG ResultSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)