167 CHAR RootPathName[4];
171 RootPathName[1] =
':';
172 RootPathName[2] =
'\\';
236 DPRINT(
"INT 21h, AH = 01h\n");
259 setAL(Character ==
'\t' ?
' ' : Character);
267 DPRINT1(
"INT 16h, 03h: Read character from STDAUX is HALFPLEMENTED\n");
276 DPRINT1(
"INT 16h, 04h: Write character to STDAUX is HALFPLEMENTED\n");
285 DPRINT1(
"INT 16h, 05h: Write character to printer is HALFPLEMENTED -\n\n");
287 DPRINT1(
"\n\n-----------\n\n");
298 if (Character != 0xFF)
332 DPRINT(
"Direct char input without echo\n");
340 DPRINT(
"Char input without echo\n");
374 DPRINT(
"Read Buffered Input\n");
407 if (InputFunction == 0x01 || InputFunction == 0x06 ||
408 InputFunction == 0x07 || InputFunction == 0x08 ||
409 InputFunction == 0x0A)
412 setAH(InputFunction);
424 DPRINT1(
"INT 21h, 0Dh is UNIMPLEMENTED\n");
511 DPRINT1(
"Setting interrupt 0x%02X to %04X:%04X ...\n",
548 else Fcb->DriveNumber = 0;
566 if ((FillChar !=
' ') || (
i != 0) || !(
Options & (1 << 2)))
568 for (;
i < 8;
i++)
Fcb->FileName[
i] = FillChar;
591 if ((FillChar !=
' ') || (
i != 0) || !(
Options & (1 << 3)))
593 for (;
i < 3;
i++)
Fcb->FileExt[
i] = FillChar;
701 DPRINT1(
"Process going resident: %u paragraphs kept\n",
getDX());
746 DPRINT1(
"INT 21h, AH = %02Xh, subfunction AL = %02Xh NOT IMPLEMENTED\n",
776 CHAR RootPath[] =
"?:\\";
777 DWORD SectorsPerCluster;
778 DWORD BytesPerSector;
779 DWORD NumberOfFreeClusters;
780 DWORD TotalNumberOfClusters;
785 RootPath[0] =
'A' +
getDL() - 1;
790 &NumberOfFreeClusters,
791 &TotalNumberOfClusters))
795 setBX(
min(NumberOfFreeClusters, 0xFFFF));
796 setDX(
min(TotalNumberOfClusters, 0xFFFF));
1117 if (
getAL() == 0x00)
1135 else if (
getAL() == 0x01)
1218 if (DriveNumber == 0)
1228 if (DriveNumber < SysVars->NumLocalDrives)
1250 WORD MaxAvailable = 0;
1262 setBX(MaxAvailable);
1333 else if (OrgAL == 0x05)
1336 DPRINT1(
"Set execution state is UNIMPLEMENTED\n");
1465 if (
MoveFileA(ExistingFileName, NewFileName))
1488 WORD FileDate, FileTime;
1515 &FileDate, &FileTime))
1574 DPRINT1(
"INT 21h, AH = %02Xh, subfunction AL = %02Xh NOT IMPLEMENTED\n",
1661 DPRINT1(
"INT 21h, AH = 59h, BX = %04Xh - Get Extended Error Information is UNIMPLEMENTED\n",
1735 if (
getAL() == 0x00)
1748 else if (
getAL() == 0x01)
1826 DPRINT1(
"INT 21h, AH = %02Xh, subfunction AL = %02Xh NOT IMPLEMENTED\n",
1839 case 0x01:
case 0x02:
case 0x03:
1840 case 0x04:
case 0x05:
case 0x06:
1911 DPRINT1(
"INT 21h, AH = %02Xh, subfunction AL = %02Xh NOT IMPLEMENTED\n",
1961 WORD CreationStatus;
1965 if (
getAL() != 0x00)
1989 setCX(CreationStatus);
2004 DPRINT1(
"INT 21h LFN Support, AH = %02Xh, AL = %02Xh NOT IMPLEMENTED!\n",
2015 DPRINT1(
"DOS Function INT 21h, AH = %02Xh, AL = %02Xh NOT IMPLEMENTED!\n",
2074 WORD KeepResident = (
getDX() + 0x0F) >> 4;
2077 DPRINT1(
"Process going resident: %u paragraphs kept\n", KeepResident);
2134 DPRINT1(
"INT 2Fh, AX=%4xh DOS Internal Utility Function called\n",
getAX());
2157 BOOLEAN AreEqual = (PointerFromFarPointer1 == PointerFromFarPointer2);
2178 if (DosVersion == 0x0000)
2219 if (
getAL() != 0x80)
goto Default;
2248 DPRINT1(
"Unknown DOS XMS Function: INT 2Fh, AH = 43h, AL = %02Xh\n",
getAL());
2257 DPRINT1(
"DOS Internal System Function INT 2Fh, AH = %02Xh, AL = %02Xh NOT IMPLEMENTED!\n",
2274 static const BYTE NullDriverRoutine[] =
2328 sizeof(NullDriverRoutine));
2347 DPRINT1(
"Current directory too long (%d > MAX_PATH) for GetCurrentDirectoryA\n", dwRet);
2358 else if (dwRet >
sizeof(DosDirectory))
2361 DPRINT1(
"Short path too long (%d > DOS_DIR_LENGTH) for GetShortPathNameA\n", dwRet);
2369 DosDirectory[1] =
':';
2370 DosDirectory[2] =
'\\';
2371 DosDirectory[3] =
'\0';
2446 "Page frame segment or number of EMS pages invalid.\n");
PRTL_UNICODE_STRING_BUFFER Path
ACPI_SIZE strlen(const char *String)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
char * strchr(const char *String, int ch)
WCHAR CurrentDirectory[1024]
WORD DosIfCharYesNo(WORD Char)
VOID DosToUpperStrZ(PSTR DestStr, PSTR SrcStr)
BOOLEAN DosCountryInitialize(VOID)
WORD DosGetCountryInfoEx(IN BYTE InfoId, IN WORD CodePage, IN WORD CountryId, OUT PDOS_COUNTRY_INFO_2 CountryInfo, IN OUT PWORD BufferSize)
WORD DosGetCountryInfo(IN OUT PWORD CountryId, OUT PDOS_COUNTRY_INFO CountryInfo)
CHAR DosToUpper(CHAR Char)
VOID DosToUpperStrN(PCHAR DestStr, PCHAR SrcStr, WORD Length)
#define ERROR_INVALID_FUNCTION
DWORD WINAPI demFileFindFirst(_Out_ PVOID pFindFileData, _In_ PCSTR FileName, _In_ WORD AttribMask)
DWORD WINAPI demFileFindNext(_Inout_ PVOID pFindFileData)
DWORD WINAPI demFileDelete(IN LPCSTR FileName)
#define DosDisplayMessage(Format,...)
#define ERROR_CALL_NOT_IMPLEMENTED
#define ERROR_INVALID_PARAMETER
#define ERROR_INVALID_HANDLE
#define ERROR_ACCESS_DENIED
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
UINT WINAPI GetDriveTypeA(IN LPCSTR lpRootPathName)
BOOL WINAPI GetDiskFreeSpaceA(IN LPCSTR lpRootPathName, OUT LPDWORD lpSectorsPerCluster, OUT LPDWORD lpBytesPerSector, OUT LPDWORD lpNumberOfFreeClusters, OUT LPDWORD lpTotalNumberOfClusters)
BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes)
BOOL WINAPI SetFileTime(IN HANDLE hFile, CONST FILETIME *lpCreationTime OPTIONAL, CONST FILETIME *lpLastAccessTime OPTIONAL, CONST FILETIME *lpLastWriteTime OPTIONAL)
BOOL WINAPI GetFileTime(IN HANDLE hFile, OUT LPFILETIME lpCreationTime OPTIONAL, OUT LPFILETIME lpLastAccessTime OPTIONAL, OUT LPFILETIME lpLastWriteTime OPTIONAL)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
BOOL WINAPI MoveFileA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
DWORD WINAPI GetShortPathNameA(IN LPCSTR lpszLongPath, OUT LPSTR lpszShortPath, IN DWORD cchBuffer)
DWORD WINAPI GetFullPathNameA(IN LPCSTR lpFileName, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime)
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
BOOL WINAPI FileTimeToDosDateTime(IN CONST FILETIME *lpFileTime, OUT LPWORD lpFatDate, OUT LPWORD lpFatTime)
VOID WINAPI DosAbsoluteWrite(LPWORD Stack)
VOID WINAPI DosIdle(LPWORD Stack)
BOOLEAN DosControlBreak(VOID)
BOOLEAN DosKRNLInitialize(VOID)
static BOOLEAN DosIsFileOnCdRom(VOID)
VOID WINAPI DosBreakInterrupt(LPWORD Stack)
VOID WINAPI DosInt27h(LPWORD Stack)
VOID WINAPI DosFastConOut(LPWORD Stack)
VOID WINAPI DosInt20h(LPWORD Stack)
VOID WINAPI DosInt2Fh(LPWORD Stack)
VOID WINAPI DosAbsoluteRead(LPWORD Stack)
static BOOLEAN DosChangeDirectory(LPSTR Directory)
VOID WINAPI DosInt2Ah(LPWORD Stack)
VOID WINAPI DosInt21h(LPWORD Stack)
static BOOLEAN DosChangeDrive(BYTE Drive)
WORD DosReadFile(WORD FileHandle, DWORD Buffer, WORD Count, LPWORD BytesRead)
PDOS_FILE_DESCRIPTOR DosGetHandleFileDescriptor(WORD DosHandle)
WORD DosOpenFile(LPWORD Handle, LPCSTR FilePath, BYTE AccessShareModes)
WORD DosCreateFileEx(LPWORD Handle, LPWORD CreationStatus, LPCSTR FilePath, BYTE AccessShareModes, WORD CreateActionFlags, WORD Attributes)
WORD DosCreateFile(LPWORD Handle, LPCSTR FilePath, DWORD CreationDisposition, WORD Attributes)
BYTE DosReadLineBuffered(WORD FileHandle, DWORD Buffer, BYTE MaxSize)
BOOLEAN DosUnlockFile(WORD DosHandle, DWORD Offset, DWORD Size)
BOOL DosFlushFileBuffers(WORD FileHandle)
WORD DosSeekFile(WORD FileHandle, LONG Offset, BYTE Origin, LPDWORD NewOffset)
BOOLEAN DosLockFile(WORD DosHandle, DWORD Offset, DWORD Size)
WORD DosWriteFile(WORD FileHandle, DWORD Buffer, WORD Count, LPWORD BytesWritten)
BOOLEAN DosDeviceIoControl(WORD FileHandle, BYTE ControlCode, DWORD Buffer, PWORD Length)
struct _DOS_SFT * PDOS_SFT
DRIVER_INITIALIZE DriverEntry
BOOLEAN EmsDrvInitialize(USHORT Segment, ULONG TotalPages)
#define SEG_OFF_TO_PTR(seg, off)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
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
BOOLEAN XmsGetDriverEntry(PDWORD Pointer)
#define RtlFillMemory(Dest, Length, Fill)
VOID Int32Call(IN PCALLBACK16 Context, IN BYTE IntNumber)
_In_ NDIS_ERROR_CODE ErrorCode
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
WCHAR NTAPI RtlUpcaseUnicodeChar(_In_ WCHAR Source)
CHAR NTAPI RtlUpperChar(_In_ CHAR Source)
#define FILE_ATTRIBUTE_DIRECTORY
_In_ ULONG _In_ ULONG _In_ ULONG Length
base for all directory entries
CHAR CurrentDirectories[NUM_DRIVES][DOS_DIR_LENGTH]
BYTE NullDriverRoutine[7]
CHAR DeviceName[MAX_DEVICE_NAME]
DOS_FILE_DESCRIPTOR FileDescriptors[ANYSIZE_ARRAY]
VOID InitializeContext(IN PCALLBACK16 Context, IN USHORT Segment, IN USHORT Offset)
CHAR DosReadCharacter(WORD FileHandle, BOOLEAN Echo)
VOID DosPrintCharacter(WORD FileHandle, CHAR Character)
BOOLEAN DosCheckInput(VOID)
VOID ConDrvInitialize(VOID)
#define DOS_DEVATTR_CHARACTER
#define INVALID_DOS_HANDLE
struct _DOS_DATA * PDOS_DATA
struct _DOS_FCB * PDOS_FCB
#define DOS_DATA_OFFSET(x)
#define DOS_CHAR_ATTRIBUTE
#define DOS_OUTPUT_HANDLE
struct _DOS_INPUT_BUFFER * PDOS_INPUT_BUFFER
#define RegisterDosInt32(IntNumber, IntHandler)
WORD DosDuplicateHandle(WORD DosHandle)
BOOLEAN DosCloseHandle(WORD DosHandle)
BOOLEAN DosResizeHandleTable(WORD NewSize)
BOOLEAN DosForceDuplicateHandle(WORD OldHandle, WORD NewHandle)
BOOLEAN DosResizeMemory(WORD BlockData, WORD NewSize, WORD *MaxAvailable)
WORD DosAllocateMemory(WORD Size, WORD *MaxAvailable)
VOID DosInitializeUmb(VOID)
BOOLEAN DosUnlinkUmb(VOID)
VOID DosInitializeMemory(VOID)
BOOLEAN DosFreeMemory(WORD BlockData)
#define DOS_ALLOC_HIGH_LOW
VOID DosClonePsp(WORD DestSegment, WORD SourceSegment)
VOID DosCreatePsp(WORD Segment, WORD ProgramSize)
DWORD DosLoadExecutable(IN DOS_EXEC_TYPE LoadType, IN LPCSTR ExecutablePath, IN PDOS_EXEC_PARAM_BLOCK Parameters, IN LPCSTR CommandLine OPTIONAL, IN LPCSTR Environment OPTIONAL, IN DWORD ReturnAddress OPTIONAL)
WORD DosCreateProcess(IN LPCSTR ProgramName, IN PDOS_EXEC_PARAM_BLOCK Parameters, IN DWORD ReturnAddress OPTIONAL)
VOID DosSetProcessContext(WORD Segment)
VOID DosTerminateProcess(WORD Psp, BYTE ReturnCode, WORD KeepResident)
#define SEGMENT_TO_PSP(seg)
#define DOS_CMDLINE_LENGTH
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
VOID WINAPI setBX(USHORT)
VOID WINAPI setCX(USHORT)
VOID WINAPI setDX(USHORT)
USHORT WINAPI getBX(VOID)
USHORT WINAPI getDS(VOID)
USHORT WINAPI getCX(VOID)
USHORT WINAPI getSI(VOID)
USHORT WINAPI getDX(VOID)
VOID WINAPI setSP(USHORT)
VOID WINAPI setDS(USHORT)
USHORT WINAPI getAX(VOID)
USHORT WINAPI getES(VOID)
USHORT WINAPI getDI(VOID)
USHORT WINAPI getSP(VOID)
VOID WINAPI setSS(USHORT)
VOID WINAPI setAX(USHORT)
VOID WINAPI setES(USHORT)
VOID WINAPI setSI(USHORT)
USHORT WINAPI getSS(VOID)
#define INVALID_FILE_ATTRIBUTES
#define BIOS_VIDEO_INTERRUPT
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
DWORD WINAPI GetLastError(void)
#define ERROR_PATH_NOT_FOUND
#define ERROR_INVALID_DRIVE
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO