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.

265 lines
6.0 KiB

  1. /*++
  2. Copyright (c) 1989-1993 Microsoft Corporation
  3. Module Name:
  4. misc.c
  5. Abstract:
  6. Provides entry points for miscellaneous functions to match the WFW3.1
  7. Network provider,
  8. The majority of the functions are either no longer supported, or
  9. call thru to other functions.
  10. Author:
  11. Chuck Y Chan (ChuckC) 25-Mar-1993
  12. Revision History:
  13. --*/
  14. #include <windows.h>
  15. #include <locals.h>
  16. WORD API WNetExitConfirm(HWND hwndOwner,
  17. WORD iExitType)
  18. {
  19. UNREFERENCED(hwndOwner) ;
  20. UNREFERENCED(hwndOwner) ;
  21. vLastCall = LAST_CALL_IS_LOCAL ;
  22. return (SetLastError(WN_NOT_SUPPORTED)) ;
  23. }
  24. BOOL API I_AutoLogon(HWND hwndOwner,
  25. LPSTR lpszReserved,
  26. BOOL fPrompt,
  27. BOOL FAR *lpfLoggedOn)
  28. {
  29. UNREFERENCED(hwndOwner) ;
  30. UNREFERENCED(lpszReserved) ;
  31. UNREFERENCED(fPrompt) ;
  32. UNREFERENCED(lpfLoggedOn) ;
  33. vLastCall = LAST_CALL_IS_LOCAL ;
  34. SetLastError(WN_NOT_SUPPORTED) ;
  35. return FALSE ;
  36. }
  37. BOOL API I_Logoff(HWND hwndOwner,
  38. LPSTR lpszReserved)
  39. {
  40. UNREFERENCED(hwndOwner) ;
  41. UNREFERENCED(lpszReserved) ;
  42. vLastCall = LAST_CALL_IS_LOCAL ;
  43. SetLastError(WN_NOT_SUPPORTED) ;
  44. return FALSE ;
  45. }
  46. VOID API I_ChangePassword(HWND hwndOwner)
  47. {
  48. UNREFERENCED(hwndOwner) ;
  49. vLastCall = LAST_CALL_IS_LOCAL ;
  50. SetLastError(WN_NOT_SUPPORTED) ;
  51. }
  52. VOID API I_ChangeCachePassword(HWND hwndOwner)
  53. {
  54. UNREFERENCED(hwndOwner) ;
  55. vLastCall = LAST_CALL_IS_LOCAL ;
  56. SetLastError(WN_NOT_SUPPORTED) ;
  57. }
  58. WORD API I_ConnectDialog(HWND hwndParent,
  59. WORD iType)
  60. {
  61. return WNetConnectDialog(hwndParent, iType) ;
  62. }
  63. WORD API I_ConnectionDialog(HWND hwndParent,
  64. WORD iType)
  65. {
  66. return WNetConnectDialog(hwndParent, iType) ;
  67. }
  68. WORD API WNetCachePassword(LPSTR pbResource,
  69. WORD cbResource,
  70. LPSTR pbPassword,
  71. WORD cbPassword,
  72. BYTE nType)
  73. {
  74. UNREFERENCED(pbResource) ;
  75. UNREFERENCED(cbResource) ;
  76. UNREFERENCED(pbPassword) ;
  77. UNREFERENCED(cbPassword) ;
  78. UNREFERENCED(nType) ;
  79. vLastCall = LAST_CALL_IS_LOCAL ;
  80. return (SetLastError(WN_NOT_SUPPORTED)) ;
  81. }
  82. WORD API WNetGetCachedPassword(LPSTR pbResource,
  83. WORD cbResource,
  84. LPSTR pbPassword,
  85. LPWORD pcbPassword,
  86. BYTE nType)
  87. {
  88. UNREFERENCED(pbResource) ;
  89. UNREFERENCED(cbResource) ;
  90. UNREFERENCED(pbPassword) ;
  91. UNREFERENCED(pcbPassword) ;
  92. UNREFERENCED(nType) ;
  93. vLastCall = LAST_CALL_IS_LOCAL ;
  94. return (SetLastError(WN_NOT_SUPPORTED)) ;
  95. }
  96. WORD API WNetRemoveCachedPassword(LPSTR pbResource,
  97. WORD cbResource,
  98. BYTE nType)
  99. {
  100. UNREFERENCED(pbResource) ;
  101. UNREFERENCED(cbResource) ;
  102. UNREFERENCED(nType) ;
  103. vLastCall = LAST_CALL_IS_LOCAL ;
  104. return (SetLastError(WN_NOT_SUPPORTED)) ;
  105. }
  106. WORD API WNetEnumCachedPasswords(LPSTR pbPrefix,
  107. WORD cbPrefix,
  108. BYTE nType,
  109. CACHECALLBACK pfnCallback)
  110. {
  111. UNREFERENCED(pbPrefix) ;
  112. UNREFERENCED(cbPrefix) ;
  113. UNREFERENCED(nType) ;
  114. UNREFERENCED(pfnCallback) ;
  115. vLastCall = LAST_CALL_IS_LOCAL ;
  116. return (SetLastError(WN_NOT_SUPPORTED)) ;
  117. }
  118. WORD API WNetSharesDialog(HWND hwndParent,
  119. WORD iType)
  120. {
  121. UNREFERENCED(hwndParent) ;
  122. UNREFERENCED(iType) ;
  123. vLastCall = LAST_CALL_IS_LOCAL ;
  124. return (SetLastError(WN_NOT_SUPPORTED)) ;
  125. }
  126. WORD API WNetSetDefaultDrive(WORD idriveDefault)
  127. {
  128. UNREFERENCED(idriveDefault) ;
  129. vLastCall = LAST_CALL_IS_LOCAL ;
  130. return (SetLastError(WN_NOT_SUPPORTED)) ;
  131. }
  132. WORD API WNetGetShareCount(WORD iType)
  133. {
  134. UNREFERENCED(iType) ;
  135. vLastCall = LAST_CALL_IS_LOCAL ;
  136. return (SetLastError(WN_NOT_SUPPORTED)) ;
  137. }
  138. WORD API WNetGetShareName(LPSTR lpszPath,
  139. LPSTR lpszBuf,
  140. WORD cbBuf)
  141. {
  142. UNREFERENCED(lpszPath) ;
  143. UNREFERENCED(lpszBuf) ;
  144. UNREFERENCED(cbBuf) ;
  145. vLastCall = LAST_CALL_IS_LOCAL ;
  146. return (SetLastError(WN_NOT_SUPPORTED)) ;
  147. }
  148. WORD API WNetGetSharePath(LPSTR lpszName,
  149. LPSTR lpszBuf,
  150. WORD cbBuf)
  151. {
  152. UNREFERENCED(lpszName) ;
  153. UNREFERENCED(lpszBuf) ;
  154. UNREFERENCED(cbBuf) ;
  155. vLastCall = LAST_CALL_IS_LOCAL ;
  156. return (SetLastError(WN_NOT_SUPPORTED)) ;
  157. }
  158. WORD API WNetGetLastConnection(WORD iType,
  159. LPWORD lpwConnIndex)
  160. {
  161. UNREFERENCED(iType) ;
  162. UNREFERENCED(lpwConnIndex) ;
  163. vLastCall = LAST_CALL_IS_LOCAL ;
  164. return (SetLastError(WN_NOT_SUPPORTED)) ;
  165. }
  166. WORD API WNetGetError(LPINT p1)
  167. {
  168. WORD err ;
  169. WORD wLastErr ;
  170. /*
  171. * fake the last error capabilty. if last thing we talked to was Win32,
  172. * the get the information from 32 bit system. ditto if it was a Win16
  173. * call.
  174. */
  175. if (vLastCall == LAST_CALL_IS_WIN32)
  176. {
  177. err = (WORD) GetLastError32() ;
  178. return err ;
  179. }
  180. else if (vLastCall == LAST_CALL_IS_LANMAN_DRV)
  181. {
  182. err = WNetGetError16(&wLastErr) ;
  183. if (err != WN_SUCCESS)
  184. return err ;
  185. else
  186. return wLastErr ;
  187. }
  188. else
  189. {
  190. return(vLastError) ;
  191. }
  192. }
  193. WORD API WNetGetErrorText(WORD p1,LPSTR p2,LPINT p3)
  194. {
  195. if (vLastCall == LAST_CALL_IS_WIN32)
  196. {
  197. *p2 = 0 ;
  198. *p3 = 0 ;
  199. return WN_NOT_SUPPORTED ;
  200. }
  201. else // use whatever lanman.drv gives us
  202. {
  203. return (WNetGetErrorText16(p1, p2, p3)) ;
  204. }
  205. }
  206. WORD API WNetErrorText(WORD p1,LPSTR p2,WORD p3)
  207. {
  208. WORD cbBuffer = p3 ;
  209. return (WNetGetErrorText(p1, p2, &cbBuffer) == 0) ;
  210. }
  211. /*
  212. * misc startup/shutdown routines. nothing interesting
  213. */
  214. VOID FAR PASCAL Enable(VOID)
  215. {
  216. return ;
  217. }
  218. VOID FAR PASCAL Disable(VOID)
  219. {
  220. return ;
  221. }
  222. int far pascal WEP()
  223. {
  224. return 0 ;
  225. }