Reactos
1//
2// direct.h
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Functions for directory handling and creation.
7//
8#pragma once
9#ifndef _INC_DIRECT // include guard for 3rd party interop
10#define _INC_DIRECT
11
12#include <corecrt.h>
13#include <corecrt_wdirect.h>
14
15#pragma warning(push)
16#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
17_UCRT_DISABLE_CLANG_WARNINGS
18
19_CRT_BEGIN_C_HEADER
20
21
22
23#ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
24
25 #ifndef _DISKFREE_T_DEFINED
26 #define _DISKFREE_T_DEFINED
27 struct _diskfree_t
28 {
29 unsigned total_clusters;
30 unsigned avail_clusters;
31 unsigned sectors_per_cluster;
32 unsigned bytes_per_sector;
33 };
34 #endif
35
36 #if _CRT_FUNCTIONS_REQUIRED
37
38 _Success_(return == 0)
39 _Check_return_
40 _DCRTIMP unsigned __cdecl _getdiskfree(
41 _In_ unsigned _Drive,
42 _Out_ struct _diskfree_t* _DiskFree
43 );
44
45 _Check_return_ _DCRTIMP int __cdecl _chdrive(_In_ int _Drive);
46
47 _Check_return_ _DCRTIMP int __cdecl _getdrive(void);
48
49 _Check_return_ _DCRTIMP unsigned long __cdecl _getdrives(void);
50
51 #endif // _CRT_FUNCTIONS_REQUIRED
52#endif // _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
53
54
55
56#pragma push_macro("_getcwd")
57#pragma push_macro("_getdcwd")
58#undef _getcwd
59#undef _getdcwd
60
61_Success_(return != 0)
62_Check_return_ _Ret_maybenull_z_
63_ACRTIMP _CRTALLOCATOR char* __cdecl _getcwd(
64 _Out_writes_opt_z_(_SizeInBytes) char* _DstBuf,
65 _In_ int _SizeInBytes
66 );
67
68_Success_(return != 0)
69_Check_return_ _Ret_maybenull_z_
70_ACRTIMP _CRTALLOCATOR char* __cdecl _getdcwd(
71 _In_ int _Drive,
72 _Out_writes_opt_z_(_SizeInBytes) char* _DstBuf,
73 _In_ int _SizeInBytes
74 );
75
76#define _getdcwd_nolock _getdcwd
77
78#pragma pop_macro("_getcwd")
79#pragma pop_macro("_getdcwd")
80
81_Check_return_ _ACRTIMP int __cdecl _chdir(_In_z_ char const* _Path);
82
83_Check_return_ _ACRTIMP int __cdecl _mkdir(_In_z_ char const* _Path);
84
85_Check_return_ _ACRTIMP int __cdecl _rmdir(_In_z_ char const* _Path);
86
87
88
89#if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES
90
91 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
92
93 #pragma push_macro("getcwd")
94 #undef getcwd
95
96 _Success_(return != 0)
97 _Check_return_ _Ret_maybenull_z_ _CRT_NONSTDC_DEPRECATE(_getcwd)
98 _DCRTIMP char* __cdecl getcwd(
99 _Out_writes_opt_z_(_SizeInBytes) char* _DstBuf,
100 _In_ int _SizeInBytes
101 );
102
103 #pragma pop_macro("getcwd")
104
105 _Check_return_ _CRT_NONSTDC_DEPRECATE(_chdir)
106 _DCRTIMP int __cdecl chdir(
107 _In_z_ char const* _Path
108 );
109
110 #define diskfree_t _diskfree_t
111
112 #endif // _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
113
114 _Check_return_ _CRT_NONSTDC_DEPRECATE(_mkdir)
115 _ACRTIMP int __cdecl mkdir(
116 _In_z_ char const* _Path
117 );
118
119 _Check_return_ _CRT_NONSTDC_DEPRECATE(_rmdir)
120 _ACRTIMP int __cdecl rmdir(
121 _In_z_ char const* _Path
122 );
123
124#endif // _CRT_INTERNAL_NONSTDC_NAMES
125
126
127
128_CRT_END_C_HEADER
129_UCRT_RESTORE_CLANG_WARNINGS
130#pragma warning(pop) // _UCRT_DISABLED_WARNINGS
131#endif // _INC_DIRECT