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.

67 lines
2.3 KiB

  1. /*++ BUILD Version: 0001
  2. *
  3. * WOW v1.0
  4. *
  5. * Copyright (c) 1993, Microsoft Corporation
  6. *
  7. * WKLDEG.H
  8. * WOW32 KRNL FAST SEGMENT LOADER
  9. *
  10. * History:
  11. * Created 4-Jan-1993 by Matthew Felton (mattfe)
  12. --*/
  13. #define BADPTR 0xDEADBEEF
  14. #define FINDMAPFILECACHE(f) FindMapFileCache(f)
  15. #define ALLOCMAPFILECACHE() AllocMapFileCache()
  16. #define FREEMAPFILECACHE(h) FreeMapFileCache(h)
  17. #define MAX_MAPPED_FILES 12
  18. #define CACHE_BYTE_THRESHOLD 64*1024
  19. #define CACHE_READ_THRESHOLD 32*1024
  20. #define CACHE_ACCESS_THRESHOLD 20
  21. #define DOS_ATTR_MASK 0x0037 // File attribute bits which are the same
  22. // for NT and DOS. See dem\dosdef.h
  23. #define IS_ASCII_PATH_SEPARATOR(ch) (((ch) == '/') || ((ch) == '\\'))
  24. typedef struct _HMAPPEDFILEALIAS { /* HMAPPEDFILEALIAS */
  25. struct _HMAPPEDFILEALIAS *hpfNext; // Pointer to Next MappedFileCacheEntry
  26. HANDLE hfile32;
  27. HANDLE hMappedFileObject;
  28. LPBYTE lpStartingAddressOfView;
  29. DWORD lFilePointer;
  30. DWORD dwFileSize;
  31. BOOL fAccess;
  32. } HMAPPEDFILEALIAS, *PHMAPPEDFILEALIAS;
  33. PHMAPPEDFILEALIAS FindMapFileCache(HANDLE hFile);
  34. PHMAPPEDFILEALIAS AllocMapFileCache();
  35. VOID FreeMapFileCache(HANDLE hFile);
  36. ULONG FASTCALL WK32WOWFileOpen(PVDMFRAME pFrame);
  37. ULONG FASTCALL WK32WOWFileCreate(PVDMFRAME pFrame);
  38. ULONG FASTCALL WK32WOWFileClose(PVDMFRAME pFrame);
  39. ULONG FASTCALL WK32WOWFileGetAttributes(PVDMFRAME pFrame);
  40. ULONG FASTCALL WK32WOWFileSetAttributes(PVDMFRAME pFrame);
  41. ULONG FASTCALL WK32WOWFileGetDateTime(PVDMFRAME pFrame);
  42. ULONG FASTCALL WK32WOWFileSetDateTime(PVDMFRAME pFrame);
  43. ULONG FASTCALL WK32WOWFileLock(PVDMFRAME pFrame);
  44. ULONG FASTCALL WK32WOWFileRead(PVDMFRAME pFrame);
  45. ULONG FASTCALL WK32WOWFileWrite(PVDMFRAME pFrame);
  46. ULONG FASTCALL WK32WOWFileLSeek(PVDMFRAME pFrame);
  47. ULONG FASTCALL WK32WOWFindFirst(PVDMFRAME pFrame);
  48. ULONG FASTCALL WK32WOWFindNext(PVDMFRAME pFrame);
  49. ULONG FASTCALL WK32FindFirstFile(PVDMFRAME pFrame);
  50. ULONG FASTCALL WK32FindNextFile(PVDMFRAME pFrame);
  51. ULONG FASTCALL WK32FindClose(PVDMFRAME pFrame);
  52. VOID InitMapFileCache();
  53. VOID InsertMapFileCache( PHMAPPEDFILEALIAS pCache );
  54. BOOL W32MapViewOfFile( PHMAPPEDFILEALIAS pCache, HANDLE hFile);
  55. VOID FlushMapFileCaches(VOID);
  56. PSTR NormalizeDosPath(PSTR pszPath, WORD wCurrentDriveNumber, PBOOL ItsANamedPipe);
  57. extern INT fileoclevel;