Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.6 KiB

  1. #ifdef KFIL // use win kernel file handling
  2. #define DosInit() (TRUE)
  3. #define DosDeInit()
  4. #define DosOpen(f, m) _lopen(f, m)
  5. #define DosClose(h) _lclose(h)
  6. #define DosCreate(f, m) _lcreat(f, m)
  7. #define DosSeek(h, off, pos) ((DWORD)_llseek(h, off, pos))
  8. #define DosRead(h, lpb, cb) _lread(h, lpb, cb)
  9. #define DosWrite(h, lpb, cb) _lwrite(h, lpb, cb)
  10. #define DosCommit(h)
  11. #endif // KFIL
  12. #ifdef DOSIO
  13. #define MAKEWORD(l,h) ((WORD)(((BYTE)(l)) | (((WORD)((BYTE)(h))) << 8)))
  14. BOOL WINAPI DosInit(void);
  15. void WINAPI DosDeInit(void);
  16. DWORD WINAPI DosCall (WORD DosAX, WORD DosBX, WORD DosCX, DWORD DosDSDX);
  17. #define DosDelete(sz) ((WORD)DosCall(0x4100, 0, 0, (DWORD)((LPSTR)(sz))))
  18. #define DosCreate(sz,a) ((WORD)DosCall(0x3C00, 0, a, (DWORD)((LPSTR)(sz))))
  19. #define DosClose(h) ((WORD)DosCall(0x3E00, h, 0, 0))
  20. #define DosCommit(h) ((WORD)DosCall(0x6800, h, 0, 0))
  21. #define DosOpen(sz, m) ((WORD)DosCall(MAKEWORD(m, 0x3D), 0, 0, (DWORD)((LPSTR)(sz))))
  22. #define DosRead(h, lpb, cb) ((WORD)DosCall(0x3F00, h, cb, (DWORD)((LPBYTE)(lpb))))
  23. #define DosWrite(h,lpb,cb) ((WORD)DosCall(0x4000, h, cb, (DWORD)((LPBYTE)(lpb))))
  24. #define DosSeek(h,off,p) DosCall(MAKEWORD(p,0x42), h, HIWORD((DWORD)(off)), MAKELONG(LOWORD((DWORD)(off)), 0))
  25. // #ifdef VPMTD_FINDFIRST
  26. // // these two return -1 on failure and unknown (probably 0x4E00 etc) on success
  27. // // the structure containing the found data is in the DTA (part of PSP)
  28. // # define DosFindFirst(sz, a) ((WORD)DosCall(0x4E00, 0, a, (DWORD)((LPSTR)(sz))))
  29. // # define DosFindNext() ((WORD)DosCall(0x4F00, 0, 0, 0))
  30. // #endif //VPMTD_FINDFIRST
  31. #endif //DOSIO