Go to the source code of this file.
◆ CheckTerminalDeviceType()
Definition at line 30 of file ctty.c.
31{
32
33 static const LPCWSTR DosLPTDevice =
L"LPT";
34 static const LPCWSTR DosCOMDevice =
L"COM";
35 static const LPCWSTR DosPRNDevice =
L"PRN";
36 static const LPCWSTR DosAUXDevice =
L"AUX";
37 static const LPCWSTR DosCONDevice =
L"CON";
38 static const LPCWSTR DosNULDevice =
L"NUL";
39
43
44#ifndef _UNICODE
45
49 {
50
52 }
56#else
58#endif
59
60
61
62
63
64
65
67 if (DeviceNameInfo != 0)
68 {
70
72 {
74 }
75 else
81 {
83 }
84
85 }
86
87#ifndef _UNICODE
89#endif
90
92}
ACPI_SIZE strlen(const char *String)
#define MultiByteToWideChar
NTSYSAPI ULONG NTAPI RtlIsDosDeviceName_U(_In_ PCWSTR Name)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Referenced by cmd_ctty().
◆ cmd_ctty()
Definition at line 102 of file ctty.c.
103{
105
108 HANDLE hDevice, hStdHandles[3];
109
110
112 {
114 return 0;
115 }
116
118 {
120 return 1;
121 }
122
123
126 {
127
128
129
130
131
132
133
134
135
136
138
139RetryOpenConsole:
140
141
142
143
144
145 if (bRetry)
146 {
149 return 1;
150 }
151
152
156 &SecAttr,
158 0,
161 {
162
163
164
165 if (bRetry)
166 return 1;
168 goto RetryOpenConsole;
169 }
170
171
172
176 &SecAttr,
178 0,
181 {
182
183
184
186
187 if (bRetry)
188 return 1;
190 goto RetryOpenConsole;
191 }
192
193
195 hStdHandles[1],
197 &hStdHandles[2],
198 0,
202 {
203
204
207 return 1;
208 }
209 }
211 {
212
213
214
215
216
217
221 &SecAttr,
223 0,
226 {
227
228
229 return 1;
230 }
231
232
234 hDevice,
236 &hStdHandles[0],
239 0);
241 {
242
243
245 return 1;
246 }
247
248
250 hDevice,
252 &hStdHandles[1],
255 0);
257 {
258
259
262 return 1;
263 }
264
265
267 hDevice,
269 &hStdHandles[2],
272 0);
274 {
275
276
280 return 1;
281 }
282
283
285 }
286 else
287 {
289 return 1;
290 }
291
292#if 0
293
294
295
296
297
298
299
300
301
302
303
305 if(oldinfd != -1)
306 dos_close(oldinfd);
308 if(oldoutfd != -1)
309 dos_close(oldoutfd);
310 if((oldoutfd =
dup(
f)) == -1)
311 failed = 1;
312
313 if(failed)
314 error_ctty_dup(
param);
315
316 return failed;
317#endif
318
319
320
325
330
335
336 return 0;
337}
BOOL WINAPI AllocConsole(VOID)
BOOL WINAPI FreeConsole(VOID)
VOID SetHandle(UINT Number, HANDLE Handle)
VOID error_req_param_missing(VOID)
VOID ConOutResPaging(BOOL StartPaging, UINT resID)
#define STRING_ERROR_INVALID_DEVICE
static WORD CheckTerminalDeviceType(IN LPCTSTR pszName)
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES
#define INVALID_HANDLE_VALUE
#define GetCurrentProcess()
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
#define ConOutResPrintf(uID,...)
_Check_return_ _CRTIMP int __cdecl dup2(_In_ int _FileHandleSrc, _In_ int _FileHandleDst)
#define DUPLICATE_SAME_ACCESS