my32.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. #include <winsock.h>
  2. // The following ifdef block is the standard way of creating macros which make exporting
  3. // from a DLL simpler. All files within this DLL are compiled with the MY32_EXPORTS
  4. // symbol defined on the command line. this symbol should not be defined on any project
  5. // that uses this DLL. This way any other project whose source files include this file see
  6. // MY32_API functions as being imported from a DLL, wheras this DLL sees symbols
  7. // defined with this macro as being exported.
  8. extern "C"
  9. {
  10. int __stdcall FindPort( int start,char *OutPath);
  11. int __stdcall FindPort_2( int start,BYTE *InByte,int InLen,char *OutPath);
  12. int __stdcall SetWritePassword(char *W_HKey,char *W_LKey,char *New_HKey,char *New_LKey,char *KeyPath);
  13. int __stdcall SetReadPassword(char *W_HKey,char *W_LKey,char *New_HKey,char *New_LKey,char *KeyPath);
  14. int __stdcall GetRetVar(int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
  15. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  16. char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath);
  17. int __stdcall WriteEncKey(char *Old_F_HKey,char *Old_F_LKey,char *Old_S_HKey,char *Old_S_LKey,
  18. char *New_F_HKey,char *New_F_LKey,char *New_S_HKey,char *New_S_LKey,char *KeyPath);
  19. int __stdcall MakeEncFile(char *InbinFile,char *KeyPath);
  20. int __stdcall TranfserVar(int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
  21. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  22. char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath);
  23. int __stdcall YtTranfser(BYTE *InByte,int in_len,int over_count,BOOL IsPub,char *KeyPath);
  24. int __stdcall CalEx(BYTE *InByte,int in_len,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
  25. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  26. char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath,int over_count);
  27. int __stdcall CalExByFile(char *InFile,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
  28. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  29. char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath,int over_count);
  30. int __stdcall YtWriteFloat(double indata,short add,char *HKey,char *LKey,char *KeyPath);
  31. int __stdcall YtWriteLong(int indata,short add,char *HKey,char *LKey,char *KeyPath);
  32. int __stdcall YtWriteEx(BYTE *InBuf,short add,short len,char *HKey,char *LKey,char *KeyPath);
  33. int __stdcall YtReadFloat(double *OutData,short add,char *HKey,char *LKey,char *KeyPath);
  34. int __stdcall YtReadLong(int *OutData,short add,char *HKey,char *LKey,char *KeyPath);
  35. int __stdcall YtReadEx(short add,short len,char *HKey,char *LKey,BYTE *dataout_buf,char *KeyPath);
  36. int __stdcall YtReadSting(char *OutString,short add,short len,char *HKey,char *LKey,char *KeyPath);
  37. int __stdcall YtWriteString(char *InString,short add,char *HKey,char *LKey,char *KeyPath);
  38. //取素数对
  39. int __stdcall GetPRIME(BYTE *p,BYTE *q,int m_len,char *KeyPath);
  40. //取密钥对
  41. int __stdcall GetRSAKey(BYTE *n,BYTE *e,BYTE *d,int m_len,char *KeyPath);
  42. //取密钥对,并返回对私钥进行加密的3DES密钥
  43. int __stdcall GetRSAKey_2(BYTE *n,BYTE *d,int m_len,char *Key_1,char *Key_2,char *Key_3,char *Key_4,char *KeyPath);
  44. //输入私钥对输入的数据进行加密
  45. int __stdcall YT_RSA_1(BYTE*e,BYTE *n,BYTE *InBuf,short len,char *KeyPath);
  46. //使用储存在加密锁中的私钥对输入的数据进行解密
  47. int __stdcall YT_RSA_2(short e_Addr,short n_Addr,BYTE *InBuf,short len,char *KeyPath);
  48. //使用输入的3DES密钥对储存在加密锁中的私钥进行解密后,再使用解密后的私钥对输入的数据进行解密
  49. int __stdcall YT_RSA_3(char *Key_1,char *Key_2,char *Key_3,char *Key_4,short Addr,BYTE *InBuf,short len,BOOL flag,char *KeyPath);
  50. //初始化3DES密钥
  51. int __stdcall YT_IniKey(char *KeyPath);
  52. //输入3des密钥对输入的数据进行加解密
  53. int __stdcall YT_3DES_1(char *Key_1,char *Key_2,char *Key_3,char *Key_4,
  54. BYTE *InBuf,short len,BOOL IsEnc,char *KeyPath);
  55. //使用储存在加密锁中的3DES对输入的数据进行加解密
  56. int __stdcall YT_3DES_2(short Addr,BYTE *InBuf,short len,BOOL flag,char *KeyPath);
  57. //使用储存在加密锁中的3DES及输入的3DES混合后对输入的数据进行加解密
  58. int __stdcall YT_3DES_3(char *Key_1,char *Key_2,char *Key_3,char *Key_4,short Addr,BYTE *InBuf,short len,BOOL flag,char *KeyPath);
  59. //字符串转化为字节数组
  60. void __stdcall StringToByteArray(char * InString,BYTE *out_data);
  61. //字节数组转化为16进制字符串
  62. void __stdcall ByteArrayToHexString(BYTE *in_data,char * OutString,int len);
  63. //取字符串的长度
  64. int __stdcall GetStringLenByByte(char * InString);
  65. //16进制字符串转化为数组
  66. void __stdcall HexStringToByteArray(char * InString,BYTE *in_data);
  67. //字节数组转化为字符串
  68. void __stdcall ByteArrayToString(char * OutString,BYTE *in_data,int m_len);
  69. BOOL __stdcall ComPareBigLong(BYTE*n,BYTE *a,short len);
  70. void __stdcall HexStringToByteArray_2(char * InString,BYTE *in_data);
  71. int __stdcall YtMd5ByFile(char *InFile,char *OutString,char *KeyPath);
  72. int __stdcall YtMd5ByFile_2(char *InFile,short Addr,char *KeyPath);
  73. int __stdcall YtMd5ByFile_3(char *InFile,short Addr,BOOL *biao,char *KeyPath);
  74. int __stdcall GetIDVersion(DWORD *ID,int *version,char *KeyPath);
  75. int __stdcall GetLongID(BYTE *OutLongIDByArray,char *OutLongIDByChar,char *KeyPath);
  76. int __stdcall WriteLimitTimes(char *Key1,char *Key2,char *Key3,char *Key4,
  77. DWORD SetTimes,char *KeyPath);
  78. int __stdcall WriteHostKey(char *Old_Key1,char *Old_Key2,char *Old_Key3,char *Old_Key4,
  79. char *New_Key1,char *New_Key2,char *New_Key3,char *New_Key4,char *KeyPath);
  80. int __stdcall GetLimitTimes(DWORD *OutTimes,char *KeyPath);
  81. // int __stdcall WriteYinZhi(char *Old_Key1,char *Old_Key2,char *Old_Key3,char *Old_Key4,
  82. // char *New_Key1,char *New_Key2,char *New_Key3,char *New_Key4,char *KeyPath);
  83. int __stdcall GetAlreadyTimes(DWORD *OutTimes,char *KeyPath);
  84. // int __stdcall MakeRemoteAuth(char *Key1,char *Old_Key2,char *Old_Key3,char *Old_Key4,
  85. // char *New_Key1,char *New_Key2,char *New_Key3,char *New_Key4,char *KeyPath);
  86. int __stdcall MakeEncFileByPublic(char *Key1,char *Key2,char *Key3,char *Key4,
  87. char *InbinFile,char *KeyPath);
  88. int __stdcall MakeAuthCode(char *Dev_Key1,char *Dev_Key2,char *Dev_Key3,char *Dev_Key4,
  89. char *LongKey,char *OutAuth,char *KeyPath);
  90. int __stdcall EdcByFile(char *Key,
  91. char *InbinFile,char *OutbinFile,char *KeyPath);
  92. int __stdcall CalPub(BYTE *InByte,int in_len,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
  93. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  94. char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath,int over_count);
  95. int __stdcall CalPubByFile(char *InFile,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
  96. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  97. char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7,char *KeyPath,int over_count);
  98. void __stdcall GetAppPath(char *OutAppPath);
  99. void __stdcall ConvertTimerToString(DWORD h_timer,DWORD l_timer,char *Year,char *Month,char *Day,char *Hour,char *Minuts,char *Second);
  100. int __stdcall GetRunTimer(char *Year,char *Month,char *Day,char *Hour,char *Minuts,char *Second,char *KeyPath);
  101. int __stdcall MakeTimerAuth(char *Key,DWORD ID,char *Year,char *Month,char *Day,
  102. char *Hour,char *Minuts,char *OutString,char *KeyPath);
  103. void __stdcall ConvertStringToTimer(DWORD *out_h_timer,DWORD *out_l_timer,char *Year,
  104. char *Month,char *Day,char *Hour,char *Minuts);
  105. DWORD __stdcall HexToInt(char* s);
  106. int __stdcall MakeTimerAuth_2(char *Key,DWORD ID,char *Year,
  107. char *Month,char *Day,char *Hour,char *Minuts,
  108. char *Add_Year,char *Add_Month,char *Add_Day,int bili,
  109. char *OutString,char *KeyPath,char *OutYear,
  110. char *OutMonth,char *OutDay,char *OutHour,char *OutMinuts);
  111. int __stdcall GetLeaveTimer(char *Year,char *Month,char *Day,char *Hour,char *Minuts,int *OutStatus,
  112. char *OutYear,char *OutMonth,char *OutDay,char *OutHour,char *OutMinuts,char *KeyPath);
  113. int __stdcall RemoteAuth(BYTE *InBuf,char *KeyPath);
  114. int __stdcall Yt3DesByKeyArray(char *KeyBuf,
  115. BYTE *InBuf,short len,BOOL IsEnc,char *KeyPath);
  116. BOOL __stdcall GetAuthFromFile(char *InFile,char *HKey,char *LKey,char *OutSetTime,DWORD *id);
  117. BOOL __stdcall ComPareTime( char *Year,char *Month,char *Day,char *Hour,char *Minuts,char *Second,
  118. char *Year_2,char *Month_2,char *Day_2,char *Hour_2,char *Minuts_2,char *Second_2,
  119. char *OutYear,char *OutMonth,char *OutDay,char *OutHour,char *OutMinuts,char *OutSecond);
  120. BOOL __stdcall WriteIniSetting(char *FileName,char *HKey,char *LKey,char *Time,DWORD id);
  121. int __stdcall ReadKeyFormEpm(char *OutAuthCode,int Addr,char *HKey,char *LKey,char *KeyPath);
  122. void __stdcall ConvertTimerToStringReal(DWORD InTimer,char *Year,char *Month,char *Day,char *Hour,char *Minuts,char *Second);
  123. DWORD __stdcall ConvertStringToTimerReal( char *Year,char *Month,char *Day,char *Hour,char *Minuts,char *Second);
  124. int __stdcall YTRSAUpdateData(char *Key_1,char *Key_2,char *Key_3,char *Key_4,char *LongKey,
  125. DWORD shortid,int InLongData,char *InString_1,char *InString_2,
  126. char *OutAuth,CHAR *VerfCode,char *KeyPath);
  127. int __stdcall WriteTimeLimitTimes(char *Key1,char *Key2,char *Key3,char *Key4,
  128. DWORD SetTimes,char *KeyPath);
  129. int __stdcall GetTimeAlreadyTimes(DWORD *OutTimes,char *KeyPath);
  130. int __stdcall GetTimeLimitTimes(DWORD *OutTimes,char *KeyPath);
  131. int __stdcall WriteTimeAuthToEprom(int addr,char *W_HKey,char *W_LKey,char *Key_1,char *Key_2,
  132. DWORD ID,char *Year,char *Month,
  133. char *Day,char *Hour,char *Minuts,char *KeyPath);
  134. int __stdcall ReadTimeAuthFromEprom(char *HKey,char *LKey,char *OutSetTime,DWORD *id,int addr,char *R_HKey,char *R_LKey,char *KeyPath);
  135. BOOL __stdcall GetAuthFromFile_Pub(char *InFile,char *PARAM1,char *PARAM2,char *PARAM3,
  136. char *PARAM4,char *PARAM5,char *PARAM6,char *OutSetTime,DWORD *id);
  137. int __stdcall ConvertStringToTimerRealEx( DWORD m_year,DWORD m_month,DWORD m_day,DWORD m_hour,
  138. DWORD m_minuts,DWORD m_second);
  139. int __stdcall GetSystemTimeByLong();
  140. int __stdcall ConnectServer(char *ServerName,int Port);
  141. int __stdcall ConnectServerEx(char *ServerName,int Port,DWORD *OutIP,DWORD *OutSockect);
  142. int __stdcall DisconnectServer ();
  143. int __stdcall StartServer (int Port);
  144. int __stdcall StopServer ();
  145. int __stdcall GetMachineCount ();
  146. int __stdcall GetClientCount();
  147. int __stdcall GetAllowClientCount ();
  148. void __stdcall SetInfoMode(int in_mode);
  149. int __stdcall GetInfoMode();
  150. int __stdcall SetRestrictMode (int ModeFlag);
  151. int __stdcall GetRestrictMode ();
  152. int __stdcall GetConnectLastError (char *ErrorInfo);
  153. int __stdcall GetIP (int count,char *OutIP);
  154. int __stdcall GetNetBoisID (int count,char *OutNetBoisID,SOCKET *OutSocket);
  155. int __stdcall GetSystemDateTime (char *OutSystemDateTime);
  156. int __stdcall GetConnectComputerInfo (int count,char *OutIP,char *ComputerName,char *OutNetBoisID,char *LastTime,DWORD *m_socket, BOOL IsALL);
  157. int __stdcall GetConnectComputerInfoByFunNum (char InFunNum,int count,char *OutIP,char *ComputerName,char *OutNetBoisID,char *LastTime,DWORD *m_socket, BOOL IsALL);
  158. int __stdcall SendString(char *InString);
  159. void __stdcall SetInfoHwnd(HWND in_hwnd);
  160. HWND __stdcall GetInfoHwnd();
  161. int __stdcall GetLocalIP(char *LocalIP);
  162. void __stdcall SetFileNotReadOnly(char *s1);
  163. void __stdcall SetVfpOverCount(DWORD over_count);
  164. void __stdcall SetVfpKeyPath(char *KeyPath);
  165. int __stdcall VfpCalExByFile(char *InFile,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
  166. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  167. char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7);
  168. int __stdcall VfpCalPubByFile(char *InFile,int *D0,int *D1,int *D2,int *D3,int *D4,int *D5,int *D6,int *D7,
  169. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  170. char *S0,char *S1,char *S2,char *S3,char *S4,char *S5,char *S6,char *S7);
  171. int __stdcall GetFunCount();
  172. int __stdcall GetFunNum(char pos);
  173. short __stdcall GetIpCountByFunNum(char FunNum);
  174. short __stdcall GetConCountByFunNum(char FunNum);
  175. short __stdcall GetConCountByIpFun(char FunNum,char *m_ip);
  176. int __stdcall IniStartServer(char *KeyPath);
  177. int __stdcall GetSetCountEx(short Addr,int *count,BOOL *IsMachine,char *OutFun,char *OutVerfCode,char *KeyPath);
  178. int __stdcall GetSetCount(short Addr,int *count,BOOL *IsMachine,char *OutFum,char *KeyPath);
  179. int __stdcall GetSetCountByFile(char *InFile,int *count,BOOL *IsMachine,char *OutFum,BOOL IsWriteToKey);
  180. int __stdcall YTRSAUpdateData_2(char *Key_1,char *Key_2,char *Key_3,char *Key_4,char *LongKey,
  181. DWORD shortid,int InLongData,BOOL IsMachine,char InFun,BYTE *OutBuf,
  182. char *OutAuth,char *VerfCode,char *KeyPath);
  183. short __stdcall AddConnectEx(BYTE InFunNum,short Addr,BOOL IfClose,char *KeyPath);
  184. int __stdcall CloseSocketByHandle(DWORD m_socket);
  185. void __stdcall GetServerPath(char *OutAppPath);
  186. int __stdcall GetTimerFromAuth(char *AuthString,char *Key,DWORD *ID,char *Year,char *Month,
  187. char *Day,char *Hour,char *Minuts,char *Second,
  188. char *KeyPath);
  189. HWND __stdcall GetEventHwnd();
  190. void __stdcall SetEventHwnd(HWND in_hwnd);
  191. int __stdcall WritePubTimeAuthToEprom(int addr,char *W_HKey,char *W_LKey,
  192. char *PARAM1,char *PARAM2,char *PARAM3,
  193. char *PARAM4,char *PARAM5,char *PARAM6,
  194. DWORD ID,char *Year,char *Month,
  195. char *Day,char *Hour,char *Minuts,char *Sec,char *KeyPath);
  196. int __stdcall ReadPubTimeAuthFromEprom(char *PARAM1,char *PARAM2,char *PARAM3,
  197. char *PARAM4,char *PARAM5,char *PARAM6,
  198. char *OutSetTime,DWORD *id,int addr,char *R_HKey,char *R_LKey,
  199. char *KeyPath);
  200. int __stdcall WriteNetAuthToEpmEx(int Addr,char *param1,char *param2,char *param3,
  201. char *param4,char *param5,char *param6,
  202. char *HKey,char *LKey,char *KeyPath);
  203. int __stdcall YtReadString(char *OutString,short add,short len,char *HKey,char *LKey,char *KeyPath);
  204. short __stdcall AddConnectNew(BYTE InFunNum,short Addr,BOOL IfClose,char *OutVerfCode,char *KeyPath);
  205. BOOL __stdcall EdccBin(char *Key,
  206. BYTE *InByte,int in_len,char *OutErrCode,char *KeyPath);
  207. void __stdcall StringToDword(DWORD *d0,DWORD *d1,DWORD *d2,char *InString);
  208. void __stdcall DwordToString(char *InString,DWORD d0);
  209. int __stdcall YtMd5(BYTE *InBuf,int m_len,char *OutString,char *KeyPath);
  210. int __stdcall YtMd5_2(BYTE *InBuf,int m_len,short Addr,char *KeyPath);
  211. int __stdcall YtMd5_3(BYTE *InBuf,int m_len,short Addr,BOOL *biao,char *KeyPath);
  212. //2008-2-16
  213. void __stdcall AutoDisConnect(DWORD timer,BOOL biao);
  214. typedef short (* OnMyConnect)( char *IP,char *ComputerName,char *NetBoisID,DWORD m_socket);
  215. void __stdcall SetCallBackFun(OnMyConnect FunConnec);
  216. // 初始化加密锁工具;
  217. int __stdcall ReSet(char *Keypath);
  218. }