ReactOS  0.4.15-dev-1150-g593bcce
path.c File Reference
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <wine/winternl.h>
#include <wine/debug.h>
Include dependency graph for path.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (path)
 
static BOOL set_ntstatus (NTSTATUS status)
 
WCHAR *CDECL wine_get_dos_file_name (LPCSTR str)
 

Function Documentation

◆ set_ntstatus()

static BOOL set_ntstatus ( NTSTATUS  status)
inlinestatic

Definition at line 30 of file path.c.

31 {
33  return !status;
34 }
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define SetLastError(x)
Definition: compat.h:500
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by wine_get_dos_file_name().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( path  )

◆ wine_get_dos_file_name()

WCHAR* CDECL wine_get_dos_file_name ( LPCSTR  str)

Definition at line 42 of file path.c.

43 {
44  UNICODE_STRING nt_name;
46  WCHAR *buffer;
47  SIZE_T len = strlen(str) + 1;
48 
49  if (str[0] != '/') /* relative path name */
50  {
51  if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
55  if (!set_ntstatus( status )) return NULL;
56  buffer = nt_name.Buffer;
57  len = nt_name.Length / sizeof(WCHAR) + 1;
58  }
59  else
60  {
61 #ifdef __REACTOS__
62  ERR("Got absolute UNIX path name in function wine_get_dos_file_name. This is not UNIX. Please fix the caller!\n");
63  ERR("File name: %s\n", str);
64 #else
65  len += 8; /* \??\unix prefix */
66  if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
68  {
70  return NULL;
71  }
72 #endif
73  }
74  if (buffer[5] == ':')
75  {
76  /* get rid of the \??\ prefix */
77  /* FIXME: should implement RtlNtPathNameToDosPathName and use that instead */
78  memmove( buffer, buffer + 4, (len - 4) * sizeof(WCHAR) );
79  }
80  else buffer[1] = '\\';
81  return buffer;
82 }
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
GLuint buffer
Definition: glext.h:5915
NTSTATUS NTAPI RtlDosPathNameToNtPathName_U_WithStatus(IN PCWSTR DosName, OUT PUNICODE_STRING NtName, OUT PCWSTR *PartName, OUT PRTL_RELATIVE_NAME_U RelativeName)
Definition: path.c:1907
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CP_UNIXCP
Definition: compat.h:79
__wchar_t WCHAR
Definition: xmlstorage.h:180
NTSYSAPI NTSTATUS CDECL wine_unix_to_nt_file_name(const ANSI_STRING *name, UNICODE_STRING *nt)
GLenum GLsizei len
Definition: glext.h:6722
#define ERR(fmt,...)
Definition: debug.h:110
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define MultiByteToWideChar
Definition: compat.h:110
static BOOL set_ntstatus(NTSTATUS status)
Definition: path.c:30
static SERVICE_STATUS status
Definition: service.c:31
#define HeapFree(x, y, z)
Definition: compat.h:483
Definition: ps.c:97

Referenced by get_dos_file_name(), get_mono_path(), search_unix_path(), and symt_fill_func_line_info().