Counter Strike : Global Offensive Source Code
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.

366 lines
10 KiB

  1. /*
  2. * $History: DK2WIN32.H $
  3. *
  4. * ***************** Version 1 *****************
  5. * User: Alun Date: 1/07/99 Time: 11:31
  6. * Created in $/DK2/Software/C Drivers/Windows/API/DLL/DK2Win32
  7. * Initial version added to Source Safe version control
  8. */
  9. #ifdef __cplusplus
  10. extern "C"
  11. {
  12. #endif
  13. /////////////////////////////////////////////////////////////////
  14. // Error Codes
  15. //
  16. // All codes are returned from DK2GetLastError and can be formated
  17. // into a message string by calling DK2FormatError
  18. /////////////////////////////////////////////////////////////////
  19. // DK2ERR_SUCCESS
  20. //
  21. // The command was successfull
  22. #define DK2ERR_SUCCESS 0x0000
  23. /////////////////////////////////////////////////////////////////
  24. // DK2ERR_TOOMANUUSERS
  25. //
  26. // One or mode DK2 network servers were found but they were all
  27. // full.
  28. #define DK2ERR_TOOMANYUSERS 0x0001
  29. /////////////////////////////////////////////////////////////////
  30. // DK2ERR_ACCESS_DENIED
  31. //
  32. // A DK2 network servers were found but access was denied, either
  33. // due to user restrictions, or invalid login memory.
  34. // See FindDK2Ex
  35. #define DK2ERR_ACCESS_DENIED 0x0002
  36. /////////////////////////////////////////////////////////////////
  37. // DK2ERR_DESKEY_NOTFOUND
  38. //
  39. // A DK2 command failed because a DK2 was not found, either
  40. // locally or accross the network
  41. #define DK2ERR_DESKEY_NOTFOUND 0x0003
  42. /////////////////////////////////////////////////////////////////
  43. // DK2ERR_NORESPONSE
  44. //
  45. // A DK2 oommand to a server failed becase the server did not
  46. // respond.
  47. #define DK2ERR_NORESPONSE 0x0004
  48. /////////////////////////////////////////////////////////////////
  49. // DK2ERR_NOSERVERS
  50. //
  51. // The drivers searched for a DK2 a network server, but none were
  52. // found.
  53. #define DK2ERR_NOSERVERS 0x0005
  54. /////////////////////////////////////////////////////////////////
  55. // DK2ERR_DRIVERNOTINSTALLED
  56. //
  57. // The DK2 drivers are not installed
  58. #define DK2ERR_DRIVERNOTINSTALLED 0x0006
  59. /////////////////////////////////////////////////////////////////
  60. // DK2ERR_COMMANDNOTSUPPORTED
  61. //
  62. // The DK2 does not support the requested command
  63. #define DK2ERR_COMMANDNOTSUPPORTED 0x0007
  64. /////////////////////////////////////////////////////////////////
  65. // DK2ERR_ALREADYNETWORK
  66. //
  67. // A local DK2 command failed because there is a server runnning
  68. // the command must be carried out over the network.
  69. #define DK2ERR_ALREADYNETWORK 0x1001
  70. /////////////////////////////////////////////////////////////////
  71. // DK2ERR_COMMANDNOTNETWORK
  72. //
  73. // A DK2 command failed because the command cannot operate over
  74. // the network
  75. #define DK2ERR_COMMANDNOTNETWORK 0x1002
  76. /////////////////////////////////////////////////////////////////
  77. // DK2ERR_TOOMANYPROGS
  78. //
  79. // The maximum possible programs using the DK2 drivers has been
  80. // reached
  81. #define DK2ERR_TOOMANYPROGS 0x1004
  82. /////////////////////////////////////////////////////////////////
  83. // DK2ERR_BADOS
  84. //
  85. // The DK2 command will not function on the current operating system
  86. #define DK2ERR_BADOS 0x1005
  87. /////////////////////////////////////////////////////////////////
  88. // DK2ERR_NETWORKONLY
  89. //
  90. // The DK2 command failed because it can only be performed across
  91. // the network and a local connection was specified
  92. #define DK2ERR_NETWORKONLY 0x1006
  93. /////////////////////////////////////////////////////////////////
  94. // DK2ERR_CANCELLED
  95. //
  96. // Returned the GDI/ECP Window is cancelled
  97. #define DK2ERR_CANCELLED 0x1007
  98. /////////////////////////////////////////////////////////////////
  99. // DK2ERR_FAILURE
  100. //
  101. // The command failed due to an error comunicating with the protocol
  102. #define DK2ERR_FAILURE 0x8000
  103. ////////////////////////////////////////////////////////////////
  104. // DK2ERR_PROTOCOLFAILURE
  105. //
  106. // The DK2 command faied due to a problem in the protocol
  107. #define DK2ERR_PROTOCOLFAILURE 0x8001
  108. ////////////////////////////////////////////////////////////////
  109. // DK2ERR_BADPARAMETER
  110. //
  111. // The DK2 command failed due to an invalid parameter passed to the
  112. // function
  113. #define DK2ERR_BADPARAMETER 0x8002
  114. ////////////////////////////////////////////////////////////////
  115. // DK2ERR_NOMEMORY
  116. //
  117. // The DK2 command failed because the function could not allocate
  118. // enough memory
  119. #define DK2ERR_NOMEMORY 0x8003
  120. ////////////////////////////////////////////////////////////////
  121. // DK2ERR_STARTPROTOCOL
  122. //
  123. // The DK2 command failed because the current protocol did not
  124. // start
  125. #define DK2ERR_STARTPROTOCOL 0x8004
  126. ////////////////////////////////////////////////////////////////
  127. // DK2ERR_NOPROTOCOL
  128. //
  129. // The DK2 command failed be cause the current protocol does not
  130. // exist or is not loaded
  131. #define DK2ERR_NOPROTOCOL 0x8005
  132. ////////////////////////////////////////////////////////////////
  133. // DK2ERR_NOSERVERMEMORY
  134. //
  135. // The DK2 command failed because the server could not allocate
  136. // enough memory
  137. #define DK2ERR_NOSERVERMEMORY 0x8006
  138. ////////////////////////////////////////////////////////////////
  139. // DK2ERR_INVALIDCONNECTION
  140. //
  141. // The DK2 command failed because the specified connection is
  142. // invalid
  143. #define DK2ERR_INVALIDCONNECTION 0x8007
  144. ////////////////////////////////////////////////////////////////
  145. // Structures
  146. ////////////////////////////////////////////////////////////////
  147. #pragma pack( 1 )
  148. #define DK2MEMORYMAP
  149. typedef struct _tDK2Memory
  150. {
  151. WORD wAddress;
  152. WORD wSeed;
  153. WORD wCount;
  154. LPSTR lpBytes;
  155. WORD wModule;
  156. } DK2MEMORY, FAR *LPDK2MEMORY;
  157. typedef struct _tDateTime
  158. {
  159. WORD wDay;
  160. WORD wMonth;
  161. WORD wYear;
  162. WORD wHour;
  163. WORD wMinute;
  164. WORD wSecond;
  165. WORD wMilliseconds;
  166. } DATETIME, *NPDATETIME, FAR *LPDATETIME;
  167. #pragma pack()
  168. ////////////////////////////////////////////////////////////////
  169. // DK2 Functions
  170. ////////////////////////////////////////////////////////////////
  171. BOOL APIENTRY DK2DriverInstalled( void );
  172. WORD APIENTRY FindDK2( LPSTR Id, LPSTR PKey );
  173. WORD APIENTRY FindDK2Ex( LPSTR Id, LPSTR PKey, LPDK2MEMORY lpDK2Memory );
  174. WORD APIENTRY FindDK2ExP( LPSTR Id, LPSTR PKey, WORD Address, WORD Seed, WORD Count, LPSTR Bytes, WORD Module );
  175. void APIENTRY DK2LogoutFromServer( WORD DataReg );
  176. WORD APIENTRY DK2FindLPTPort( WORD Port );
  177. WORD APIENTRY DK2GetDelayTime ( void );
  178. void APIENTRY DK2SetDelayTime( WORD Delay );
  179. void APIENTRY DK2ReadRandomNumbers( WORD DataReg,
  180. LPSTR Id,
  181. WORD Seed,
  182. LPSTR Buffer,
  183. WORD BytesToRead );
  184. void APIENTRY DK2ThroughEncryption( WORD DataReg,
  185. LPSTR Id,
  186. WORD Seed,
  187. LPSTR Buffer,
  188. WORD BytesToEncrypt );
  189. void APIENTRY DK2ReadMemory( WORD DataReg,
  190. LPSTR Id,
  191. WORD Seed,
  192. WORD Address,
  193. LPSTR Buffer,
  194. WORD BytesToRead );
  195. void APIENTRY DK2WriteMemory( WORD DataReg,
  196. LPSTR Id,
  197. WORD Seed,
  198. WORD Address,
  199. LPSTR Buffer,
  200. WORD BytesToWrite,
  201. LPSTR Password );
  202. void APIENTRY DK2ReadDownCounter( WORD DataReg,
  203. LPSTR Id,
  204. DWORD *DownCounter );
  205. void APIENTRY DK2DecrementDownCounter( WORD DataReg,
  206. LPSTR Id );
  207. BOOL APIENTRY DK2RegisterModule( WORD DataReg, WORD wModule );
  208. BOOL APIENTRY DK2UnregisterModule( WORD DataReg, WORD wModule );
  209. void APIENTRY DK2RestartDownCounter( WORD DataReg,
  210. LPSTR Id,
  211. DWORD NewCounter,
  212. LPSTR Password );
  213. void APIENTRY DK2ReadDUSN( WORD DataReg,
  214. LPSTR Id,
  215. LPSTR Password,
  216. LPWORD SecCount,
  217. LPSTR DUSN );
  218. void APIENTRY DK2SendAlgorithmString( WORD DataReg,
  219. LPSTR Id,
  220. WORD Iteration1,
  221. WORD Iteration2,
  222. LPSTR Buffer1,
  223. LPSTR Buffer2 );
  224. void APIENTRY DK2SendAlgorithmBuffer( WORD DataReg,
  225. LPSTR Id,
  226. LPWORD Iteration,
  227. LPSTR Buffer,
  228. WORD BufferCount );
  229. void APIENTRY DK2SendAndReceive( WORD DataReg, LPSTR Id, LPSTR lpFirst, WORD wFirst, LPSTR lpSend, WORD wSend, LPSTR lpReceive, WORD wReceive, WORD wCount );
  230. BOOL APIENTRY DK2Success( void );
  231. void APIENTRY DK2AllowChangeInterrupts( WORD Change );
  232. WORD APIENTRY DK2DetectSpeed( WORD DataReg,
  233. LPSTR Id );
  234. WORD APIENTRY DK2SubDetectSpeed( WORD DataReg,
  235. LPSTR Id,
  236. LPSTR PKey,
  237. LPSTR Bytes );
  238. ////////////////////////////////////////////////////////////////
  239. // time function
  240. void APIENTRY DK2GetSystemTime( WORD DateReg, LPSTR Id, LPDATETIME lpDateTime );
  241. ////////////////////////////////////////////////////////////////
  242. // DK2 Flags
  243. #define DK2_BITRONICS 0x00000001
  244. #define DK2_HASBITRONICS 0x00000002
  245. DWORD APIENTRY DK2GetFlags ( WORD DataReg,
  246. LPSTR Id );
  247. VOID APIENTRY DK2SetFlags ( WORD DataReg,
  248. LPSTR Id,
  249. DWORD Flags );
  250. ////////////////////////////////////////////////////////////////
  251. WORD APIENTRY DK2Encode( LPSTR lpszData,
  252. WORD cbData,
  253. LPSTR lpszEncode,
  254. WORD cbEncode );
  255. WORD APIENTRY DK2Decode( LPSTR lpszData,
  256. LPSTR lpszDecode );
  257. ////////////////////////////////////////////////////////////////
  258. // DK2 Access Flags - Override Searching Network or Local
  259. #define DNET_NETWORK 0x0001
  260. #define DNET_LOCAL 0x0002
  261. void APIENTRY DK2SetAccessFlags( WORD wFlags );
  262. ////////////////////////////////////////////////////////////////
  263. DWORD APIENTRY DK2GetLastError( void );
  264. void APIENTRY DK2FormatError( DWORD Error, LPSTR ErrorString, int MaxLen );
  265. WORD APIENTRY DK2GetServerName( WORD DataReg, LPSTR lpszServerName, LPSTR lpszComputerName );
  266. #ifdef __cplusplus
  267. }
  268. #endif