#include "ntvdm.h"
#include <debug.h>
#include "emulator.h"
#include "dos.h"
#include "dos/dem.h"
#include "dosfiles.h"
#include "handle.h"
#include "memory.h"
#include "process.h"
Go to the source code of this file.
◆ NDEBUG
◆ DosCloseHandle()
Definition at line 311 of file handle.c.
312{
316
317 DPRINT(
"DosCloseHandle: DosHandle 0x%04X\n", DosHandle);
318
319
321
322
325
326
328
329
332
333
335
336
338 {
340 {
342
343
345 }
346 else
347 {
348
350 }
351 }
352
353
355
357}
PDOS_FILE_DESCRIPTOR DosGetFileDescriptor(BYTE Id)
static XMS_HANDLE HandleTable[XMS_MAX_HANDLES]
PDOS_DEVICE_NODE DosGetDriverNode(DWORD Driver)
#define SEGMENT_TO_PSP(seg)
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Referenced by DosForceDuplicateHandle(), DosInt21h(), and DosTerminateProcess().
◆ DosCopyHandleTable()
VOID DosCopyHandleTable |
( |
LPBYTE |
DestinationTable | ) |
|
Definition at line 27 of file handle.c.
28{
33
34
36
37
39 {
42
43
47
48 for (
i = 0;
i < 3;
i++)
49 {
50
52 {
54 }
55 else
56 {
58 }
59
60 if (DescriptorId != 0xFF)
61 {
63 }
64 else
65 {
66
68 if (DescriptorId == 0xFF)
69 {
70 DPRINT1(
"Cannot create standard handle %d, the SFT is full!\n",
i);
71 continue;
72 }
73
77
79 {
81
86
87
89 }
90 else
91 {
93 }
94 }
95
97 DestinationTable[
i] = DescriptorId;
98 }
99 }
100 else
101 {
102
105
106
108 {
110 DestinationTable[
i] = SourceTable[
i];
111
112
114 }
115 }
116}
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
BYTE DosFindWin32Descriptor(HANDLE Win32Handle)
BYTE DosFindFreeDescriptor(VOID)
BYTE DosFindDeviceDescriptor(DWORD DevicePointer)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define RtlFillMemory(Dest, Length, Fill)
#define IsConsoleHandle(h)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STD_OUTPUT_HANDLE
Referenced by DosCreatePsp().
◆ DosDuplicateHandle()
WORD DosDuplicateHandle |
( |
WORD |
DosHandle | ) |
|
Definition at line 256 of file handle.c.
257{
259
260 if (DescriptorId == 0xFF)
261 {
264 }
265
267}
#define ERROR_INVALID_HANDLE
#define INVALID_DOS_HANDLE
BYTE DosQueryHandle(WORD DosHandle)
WORD DosOpenHandle(BYTE DescriptorId)
Referenced by DosInt21h().
◆ DosForceDuplicateHandle()
Definition at line 269 of file handle.c.
270{
275
276 DPRINT(
"DosForceDuplicateHandle: OldHandle 0x%04X, NewHandle 0x%04X\n",
277 OldHandle,
278 NewHandle);
279
280
282
283
286
287
289
290
292 {
293
295 }
296
300
301
303
304
306
307
309}
BOOLEAN DosCloseHandle(WORD DosHandle)
Referenced by DosInt21h().
◆ DosOpenHandle()
◆ DosQueryHandle()
◆ DosResizeHandleTable()
Definition at line 118 of file handle.c.
119{
123
124
126
128 {
129
131 }
132
134 {
135
137
139 {
140
142
143
145
146
148
149
152 }
153 else
154 {
155
157 {
158
161
162
164
165
169
170
172 }
173
174
176 }
177 }
179 {
182
183
185
186
190
191
194 }
195
197}
#define SEG_OFF_TO_PTR(seg, off)
_Must_inspect_result_ _In_ USHORT NewSize
BOOLEAN DosResizeMemory(WORD BlockData, WORD NewSize, WORD *MaxAvailable)
WORD DosAllocateMemory(WORD Size, WORD *MaxAvailable)
BOOLEAN DosFreeMemory(WORD BlockData)
Referenced by DosInt21h().