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.

153 lines
4.1 KiB

  1. /*++
  2. Copyright (c) 1989-1993 Microsoft Corporation
  3. Module Name:
  4. locals.h
  5. Abstract:
  6. Provides the common definitions for this project.
  7. Author:
  8. Chuck Y Chan (ChuckC) 25-Mar-1993
  9. Revision History:
  10. --*/
  11. #define LFN 1
  12. #include <winnet.h>
  13. #include <wfwnet.h>
  14. #include <spl_wnt.h>
  15. #include <bseerr.h>
  16. /*
  17. * global manifests
  18. */
  19. //
  20. // used to figure out how to get the last error.
  21. //
  22. #define LAST_CALL_IS_LOCAL (0)
  23. #define LAST_CALL_IS_LANMAN_DRV (1)
  24. #define LAST_CALL_IS_WIN32 (2)
  25. //
  26. // the various DLLs we rely on to do the real work.
  27. //
  28. #define LANMAN_DRV "LANMAN.DRV"
  29. #define MPR_DLL "MPR.DLL"
  30. #define MPRUI_DLL "MPRUI.DLL"
  31. #define NTLANMAN_DLL "NTLANMAN.DLL"
  32. #define KERNEL32_DLL "KERNEL32.DLL"
  33. #define WINSPOOL_DRV "WINSPOOL.DRV"
  34. //
  35. // some convenient manifests for above so we dont need to
  36. // do strcmp()s all the time.
  37. //
  38. #define USE_MPR_DLL (0)
  39. #define USE_MPRUI_DLL (1)
  40. #define USE_NTLANMAN_DLL (2)
  41. #define USE_KERNEL32_DLL (3)
  42. #define USE_WINSPOOL_DRV (4)
  43. //
  44. // resource type expected by Win32 APIs
  45. //
  46. #define RESOURCETYPE_ANY 0x00000000
  47. #define RESOURCETYPE_DISK 0x00000001
  48. #define RESOURCETYPE_PRINT 0x00000002
  49. #define RESOURCETYPE_ERROR 0xFFFFFFFF
  50. //
  51. // errors unknown in 16bit world.
  52. //
  53. #define WIN32_EXTENDED_ERROR 1208L
  54. #define WIN32_WN_CANCEL 1223L
  55. //
  56. // misc convenient macros
  57. //
  58. #define UNREFERENCED(x) (void)x
  59. #define TO_HWND32(x) (0xFFFF0000 | (DWORD)x)
  60. /*
  61. * various typedefs for the 16 bit functions we dynamically load
  62. */
  63. typedef void (API *LPFN)();
  64. typedef WORD (API *LPWNETOPENJOB)(LPSTR,LPSTR,WORD,LPINT);
  65. typedef WORD (API *LPWNETCLOSEJOB)(WORD,LPINT,LPSTR);
  66. typedef WORD (API *LPWNETWRITEJOB)(HANDLE,LPSTR,LPINT);
  67. typedef WORD (API *LPWNETABORTJOB)(WORD,LPSTR);
  68. typedef WORD (API *LPWNETHOLDJOB)(LPSTR,WORD);
  69. typedef WORD (API *LPWNETRELEASEJOB)(LPSTR,WORD);
  70. typedef WORD (API *LPWNETCANCELJOB)(LPSTR,WORD);
  71. typedef WORD (API *LPWNETSETJOBCOPIES)(LPSTR,WORD,WORD);
  72. typedef WORD (API *LPWNETWATCHQUEUE)(HWND,LPSTR,LPSTR,WORD);
  73. typedef WORD (API *LPWNETUNWATCHQUEUE)(LPSTR);
  74. typedef WORD (API *LPWNETLOCKQUEUEDATA)(LPSTR,LPSTR,LPQUEUESTRUCT FAR *);
  75. typedef WORD (API *LPWNETUNLOCKQUEUEDATA)(LPSTR);
  76. typedef WORD (API *LPWNETQPOLL)(HWND,WORD,WORD,LONG);
  77. typedef WORD (API *LPWNETDEVICEMODE)(HWND);
  78. typedef WORD (API *LPWNETVIEWQUEUEDIALOG)(HWND,LPSTR);
  79. typedef WORD (API *LPWNETGETCAPS)(WORD);
  80. typedef WORD (API *LPWNETGETERROR)(LPINT);
  81. typedef WORD (API *LPWNETGETERRORTEXT)(WORD,LPSTR,LPINT);
  82. typedef WORD (API *LPLFNFINDFIRST)(LPSTR,WORD,LPINT,LPINT,WORD,PFILEFINDBUF2);
  83. typedef WORD (API *LPLFNFINDNEXT)(HANDLE,LPINT,WORD,PFILEFINDBUF2);
  84. typedef WORD (API *LPLFNFINDCLOSE)(HANDLE);
  85. typedef WORD (API *LPLFNGETATTRIBUTES)(LPSTR,LPINT);
  86. typedef WORD (API *LPLFNSETATTRIBUTES)(LPSTR,WORD);
  87. typedef WORD (API *LPLFNCOPY)(LPSTR,LPSTR,PQUERYPROC);
  88. typedef WORD (API *LPLFNMOVE)(LPSTR,LPSTR);
  89. typedef WORD (API *LPLFNDELETE)(LPSTR);
  90. typedef WORD (API *LPLFNMKDIR)(LPSTR);
  91. typedef WORD (API *LPLFNRMDIR)(LPSTR);
  92. typedef WORD (API *LPLFNGETVOLUMELABEL)(WORD,LPSTR);
  93. typedef WORD (API *LPLFNSETVOLUMELABEL)(WORD,LPSTR);
  94. typedef WORD (API *LPLFNPARSE)(LPSTR,LPSTR,LPSTR);
  95. typedef WORD (API *LPLFNVOLUMETYPE)(WORD,LPINT);
  96. /*
  97. * other misc global data/functions
  98. */
  99. extern WORD vLastCall ;
  100. extern WORD vLastError ;
  101. extern WORD wNetTypeCaps ;
  102. extern WORD wUserCaps ;
  103. extern WORD wConnectionCaps ;
  104. extern WORD wErrorCaps ;
  105. extern WORD wDialogCaps ;
  106. extern WORD wAdminCaps ;
  107. extern WORD wSpecVersion;
  108. extern WORD wDriverVersion;
  109. WORD API WNetGetCaps16(WORD p1) ;
  110. WORD API WNetGetError16(LPINT p1) ;
  111. WORD API WNetGetErrorText16(WORD p1, LPSTR p2, LPINT p3) ;
  112. DWORD API GetLastError32(VOID) ;
  113. WORD SetLastError(WORD err) ;
  114. DWORD MapWNType16To32(WORD nType) ;
  115. WORD MapWin32ErrorToWN16(DWORD err) ;
  116. WORD GetLanmanDrvEntryPoints(LPFN *lplpfn,
  117. LPSTR lpName) ;
  118. //
  119. // we define this because the compiler chokes if we add yet
  120. // more to the include path to get to lmerr.h.
  121. //
  122. // this is not that bad since the value below will never change.
  123. //
  124. #define NERR_BASE 2100
  125. #define NERR_UseNotFound (NERR_BASE+150)