my32.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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( long start,TCHAR *OutPath);
  11. int __stdcall FindPort_2( long start,BYTE *InByte,long InLen,TCHAR *OutPath);
  12. int __stdcall SetWritePassword(TCHAR *W_HKey,TCHAR *W_LKey,TCHAR *New_HKey,TCHAR *New_LKey,TCHAR *KeyPath);
  13. int __stdcall SetReadPassword(TCHAR *W_HKey,TCHAR *W_LKey,TCHAR *New_HKey,TCHAR *New_LKey,TCHAR *KeyPath);
  14. int __stdcall GetRetVar(long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
  15. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  16. TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath);
  17. int __stdcall WriteEncKey(TCHAR *Old_F_HKey,TCHAR *Old_F_LKey,TCHAR *Old_S_HKey,TCHAR *Old_S_LKey,
  18. TCHAR *New_F_HKey,TCHAR *New_F_LKey,TCHAR *New_S_HKey,TCHAR *New_S_LKey,TCHAR *KeyPath);
  19. int __stdcall MakeEncFile(TCHAR *InbinFile,TCHAR *KeyPath);
  20. int __stdcall TranfserVar(long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
  21. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  22. TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath);
  23. int __stdcall YtTranfser(BYTE *InByte,long in_len,long over_count,BOOL IsPub,TCHAR *KeyPath);
  24. int __stdcall CalEx(BYTE *InByte,long in_len,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
  25. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  26. TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath,long over_count);
  27. int __stdcall CalExByFile(TCHAR *InFile,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
  28. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  29. TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath,long over_count);
  30. int __stdcall YtWriteFloat(double indata,short add,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
  31. int __stdcall YtWriteLong(long indata,short add,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
  32. int __stdcall YtWriteEx(BYTE *InBuf,short add,short len,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
  33. int __stdcall YtReadFloat(double *OutData,short add,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
  34. int __stdcall YtReadLong(long *OutData,short add,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
  35. int __stdcall YtReadEx(short add,short len,TCHAR *HKey,TCHAR *LKey,BYTE *dataout_buf,TCHAR *KeyPath);
  36. int __stdcall YtReadSting(TCHAR *OutString,short add,short len,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
  37. int __stdcall YtWriteString(TCHAR *InString,short add,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
  38. //取素数对
  39. int __stdcall GetPRIME(BYTE *p,BYTE *q,int m_len,TCHAR *KeyPath);
  40. //取密钥对
  41. int __stdcall GetRSAKey(BYTE *n,BYTE *e,BYTE *d,int m_len,TCHAR *KeyPath);
  42. //取密钥对,并返回对私钥进行加密的3DES密钥
  43. int __stdcall GetRSAKey_2(BYTE *n,BYTE *d,int m_len,TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,TCHAR *KeyPath);
  44. //输入私钥对输入的数据进行加密
  45. int __stdcall YT_RSA_1(BYTE*e,BYTE *n,BYTE *InBuf,short len,TCHAR *KeyPath);
  46. //使用储存在加密锁中的私钥对输入的数据进行解密
  47. int __stdcall YT_RSA_2(short e_Addr,short n_Addr,BYTE *InBuf,short len,TCHAR *KeyPath);
  48. //使用输入的3DES密钥对储存在加密锁中的私钥进行解密后,再使用解密后的私钥对输入的数据进行解密
  49. int __stdcall YT_RSA_3(TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,short Addr,BYTE *InBuf,short len,BOOL flag,TCHAR *KeyPath);
  50. //初始化3DES密钥
  51. int __stdcall YT_IniKey(TCHAR *KeyPath);
  52. //输入3des密钥对输入的数据进行加解密
  53. int __stdcall YT_3DES_1(TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,
  54. BYTE *InBuf,short len,BOOL IsEnc,TCHAR *KeyPath);
  55. //使用储存在加密锁中的3DES对输入的数据进行加解密
  56. int __stdcall YT_3DES_2(short Addr,BYTE *InBuf,short len,BOOL flag,TCHAR *KeyPath);
  57. //使用储存在加密锁中的3DES及输入的3DES混合后对输入的数据进行加解密
  58. int __stdcall YT_3DES_3(TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,short Addr,BYTE *InBuf,short len,BOOL flag,TCHAR *KeyPath);
  59. //字符串转化为字节数组
  60. void __stdcall StringToByteArray(TCHAR * InString,BYTE *out_data);
  61. //字节数组转化为16进制字符串
  62. void __stdcall ByteArrayToHexString(BYTE *in_data,TCHAR * OutString,int len);
  63. //取字符串的长度
  64. long __stdcall GetStringLenByByte(TCHAR * InString);
  65. //16进制字符串转化为数组
  66. void __stdcall HexStringToByteArray(TCHAR * InString,BYTE *in_data);
  67. //字节数组转化为字符串
  68. void __stdcall ByteArrayToString(TCHAR * OutString,BYTE *in_data,int m_len);
  69. BOOL __stdcall ComPareBigLong(BYTE*n,BYTE *a,short len);
  70. void __stdcall HexStringToByteArray_2(TCHAR * InString,BYTE *in_data);
  71. int __stdcall YtMd5ByFile(TCHAR *InFile,TCHAR *OutString,TCHAR *KeyPath);
  72. int __stdcall YtMd5ByFile_2(TCHAR *InFile,short Addr,TCHAR *KeyPath);
  73. int __stdcall YtMd5ByFile_3(TCHAR *InFile,short Addr,BOOL *biao,TCHAR *KeyPath);
  74. int __stdcall GetIDVersion(DWORD *ID,int *version,TCHAR *KeyPath);
  75. int __stdcall GetLongID(BYTE *OutLongIDByArray,TCHAR *OutLongIDByChar,TCHAR *KeyPath);
  76. int __stdcall WriteLimitTimes(TCHAR *Key1,TCHAR *Key2,TCHAR *Key3,TCHAR *Key4,
  77. DWORD SetTimes,TCHAR *KeyPath);
  78. int __stdcall WriteHostKey(TCHAR *Old_Key1,TCHAR *Old_Key2,TCHAR *Old_Key3,TCHAR *Old_Key4,
  79. TCHAR *New_Key1,TCHAR *New_Key2,TCHAR *New_Key3,TCHAR *New_Key4,TCHAR *KeyPath);
  80. int __stdcall GetLimitTimes(DWORD *OutTimes,TCHAR *KeyPath);
  81. // int __stdcall WriteYinZhi(TCHAR *Old_Key1,TCHAR *Old_Key2,TCHAR *Old_Key3,TCHAR *Old_Key4,
  82. // TCHAR *New_Key1,TCHAR *New_Key2,TCHAR *New_Key3,TCHAR *New_Key4,TCHAR *KeyPath);
  83. int __stdcall GetAlreadyTimes(DWORD *OutTimes,TCHAR *KeyPath);
  84. // int __stdcall MakeRemoteAuth(TCHAR *Key1,TCHAR *Old_Key2,TCHAR *Old_Key3,TCHAR *Old_Key4,
  85. // TCHAR *New_Key1,TCHAR *New_Key2,TCHAR *New_Key3,TCHAR *New_Key4,TCHAR *KeyPath);
  86. int __stdcall MakeEncFileByPublic(TCHAR *Key1,TCHAR *Key2,TCHAR *Key3,TCHAR *Key4,
  87. TCHAR *InbinFile,TCHAR *KeyPath);
  88. int __stdcall MakeAuthCode(TCHAR *Dev_Key1,TCHAR *Dev_Key2,TCHAR *Dev_Key3,TCHAR *Dev_Key4,
  89. TCHAR *LongKey,TCHAR *OutAuth,TCHAR *KeyPath);
  90. int __stdcall EdcByFile(TCHAR *Key,
  91. TCHAR *InbinFile,TCHAR *OutbinFile,TCHAR *KeyPath);
  92. int __stdcall CalPub(BYTE *InByte,long in_len,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
  93. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  94. TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath,long over_count);
  95. int __stdcall CalPubByFile(TCHAR *InFile,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
  96. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  97. TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7,TCHAR *KeyPath,long over_count);
  98. void __stdcall GetAppPath(TCHAR *OutAppPath);
  99. void __stdcall ConvertTimerToString(DWORD h_timer,DWORD l_timer,TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second);
  100. int __stdcall GetRunTimer(TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second,TCHAR *KeyPath);
  101. int __stdcall MakeTimerAuth(TCHAR *Key,DWORD ID,TCHAR *Year,TCHAR *Month,TCHAR *Day,
  102. TCHAR *Hour,TCHAR *Minuts,TCHAR *OutString,TCHAR *KeyPath);
  103. void __stdcall ConvertStringToTimer(DWORD *out_h_timer,DWORD *out_l_timer,TCHAR *Year,
  104. TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts);
  105. DWORD __stdcall HexToInt(char* s);
  106. int __stdcall MakeTimerAuth_2(TCHAR *Key,DWORD ID,TCHAR *Year,
  107. TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,
  108. TCHAR *Add_Year,TCHAR *Add_Month,TCHAR *Add_Day,int bili,
  109. TCHAR *OutString,TCHAR *KeyPath,TCHAR *OutYear,
  110. TCHAR *OutMonth,TCHAR *OutDay,TCHAR *OutHour,TCHAR *OutMinuts);
  111. int __stdcall GetLeaveTimer(TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,int *OutStatus,
  112. TCHAR *OutYear,TCHAR *OutMonth,TCHAR *OutDay,TCHAR *OutHour,TCHAR *OutMinuts,TCHAR *KeyPath);
  113. int __stdcall RemoteAuth(BYTE *InBuf,TCHAR *KeyPath);
  114. int __stdcall Yt3DesByKeyArray(TCHAR *KeyBuf,
  115. BYTE *InBuf,short len,BOOL IsEnc,TCHAR *KeyPath);
  116. BOOL __stdcall GetAuthFromFile(TCHAR *InFile,TCHAR *HKey,TCHAR *LKey,TCHAR *OutSetTime,DWORD *id);
  117. BOOL __stdcall ComPareTime( TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second,
  118. TCHAR *Year_2,TCHAR *Month_2,TCHAR *Day_2,TCHAR *Hour_2,TCHAR *Minuts_2,TCHAR *Second_2,
  119. TCHAR *OutYear,TCHAR *OutMonth,TCHAR *OutDay,TCHAR *OutHour,TCHAR *OutMinuts,TCHAR *OutSecond);
  120. BOOL __stdcall WriteIniSetting(TCHAR *FileName,TCHAR *HKey,TCHAR *LKey,TCHAR *Time,DWORD id);
  121. int __stdcall ReadKeyFormEpm(TCHAR *OutAuthCode,int Addr,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
  122. void __stdcall ConvertTimerToStringReal(DWORD InTimer,TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second);
  123. DWORD __stdcall ConvertStringToTimerReal( TCHAR *Year,TCHAR *Month,TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second);
  124. int __stdcall YTRSAUpdateData(TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,TCHAR *LongKey,
  125. DWORD shortid,long InLongData,TCHAR *InString_1,TCHAR *InString_2,
  126. TCHAR *OutAuth,CHAR *VerfCode,TCHAR *KeyPath);
  127. int __stdcall WriteTimeLimitTimes(TCHAR *Key1,TCHAR *Key2,TCHAR *Key3,TCHAR *Key4,
  128. DWORD SetTimes,TCHAR *KeyPath);
  129. int __stdcall GetTimeAlreadyTimes(DWORD *OutTimes,TCHAR *KeyPath);
  130. int __stdcall GetTimeLimitTimes(DWORD *OutTimes,TCHAR *KeyPath);
  131. int __stdcall WriteTimeAuthToEprom(int addr,TCHAR *W_HKey,TCHAR *W_LKey,TCHAR *Key_1,TCHAR *Key_2,
  132. DWORD ID,TCHAR *Year,TCHAR *Month,
  133. TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *KeyPath);
  134. int __stdcall ReadTimeAuthFromEprom(TCHAR *HKey,TCHAR *LKey,TCHAR *OutSetTime,DWORD *id,int addr,TCHAR *R_HKey,TCHAR *R_LKey,TCHAR *KeyPath);
  135. BOOL __stdcall GetAuthFromFile_Pub(TCHAR *InFile,TCHAR *PARAM1,TCHAR *PARAM2,TCHAR *PARAM3,
  136. TCHAR *PARAM4,TCHAR *PARAM5,TCHAR *PARAM6,TCHAR *OutSetTime,DWORD *id);
  137. LONG __stdcall ConvertStringToTimerRealEx( DWORD m_year,DWORD m_month,DWORD m_day,DWORD m_hour,
  138. DWORD m_minuts,DWORD m_second);
  139. LONG __stdcall GetSystemTimeByLong();
  140. int __stdcall ConnectServer(TCHAR *ServerName,int Port);
  141. int __stdcall ConnectServerEx(TCHAR *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 (TCHAR *ErrorInfo);
  153. int __stdcall GetIP (int count,TCHAR *OutIP);
  154. int __stdcall GetNetBoisID (int count,TCHAR *OutNetBoisID,SOCKET *OutSocket);
  155. int __stdcall GetSystemDateTime (TCHAR *OutSystemDateTime);
  156. int __stdcall GetConnectComputerInfo (int count,TCHAR *OutIP,TCHAR *ComputerName,TCHAR *OutNetBoisID,TCHAR *LastTime,DWORD *m_socket, BOOL IsALL);
  157. int __stdcall GetConnectComputerInfoByFunNum (char InFunNum,int count,TCHAR *OutIP,TCHAR *ComputerName,TCHAR *OutNetBoisID,TCHAR *LastTime,DWORD *m_socket, BOOL IsALL);
  158. int __stdcall SendString(TCHAR *InString);
  159. void __stdcall SetInfoHwnd(HWND in_hwnd);
  160. HWND __stdcall GetInfoHwnd();
  161. int __stdcall GetLocalIP(TCHAR *LocalIP);
  162. void __stdcall SetFileNotReadOnly(TCHAR *s1);
  163. void __stdcall SetVfpOverCount(DWORD over_count);
  164. void __stdcall SetVfpKeyPath(TCHAR *KeyPath);
  165. int __stdcall VfpCalExByFile(TCHAR *InFile,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
  166. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  167. TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *S7);
  168. int __stdcall VfpCalPubByFile(TCHAR *InFile,long *D0,long *D1,LONG *D2,LONG *D3,LONG *D4,LONG *D5,LONG *D6,LONG *D7,
  169. double *F0,double *F1,double *F2,double *F3,double *F4,double *F5,double *F6,double *F7,
  170. TCHAR *S0,TCHAR *S1,TCHAR *S2,TCHAR *S3,TCHAR *S4,TCHAR *S5,TCHAR *S6,TCHAR *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(TCHAR *KeyPath);
  177. int __stdcall GetSetCountEx(short Addr,long *count,BOOL *IsMachine,char *OutFun,TCHAR *OutVerfCode,TCHAR *KeyPath);
  178. int __stdcall GetSetCount(short Addr,long *count,BOOL *IsMachine,char *OutFum,TCHAR *KeyPath);
  179. int __stdcall GetSetCountByFile(TCHAR *InFile,long *count,BOOL *IsMachine,char *OutFum,BOOL IsWriteToKey);
  180. int __stdcall YTRSAUpdateData_2(TCHAR *Key_1,TCHAR *Key_2,TCHAR *Key_3,TCHAR *Key_4,TCHAR *LongKey,
  181. DWORD shortid,long InLongData,BOOL IsMachine,char InFun,BYTE *OutBuf,
  182. TCHAR *OutAuth,TCHAR *VerfCode,TCHAR *KeyPath);
  183. short __stdcall AddConnectEx(BYTE InFunNum,short Addr,BOOL IfClose,TCHAR *KeyPath);
  184. int __stdcall CloseSocketByHandle(DWORD m_socket);
  185. void __stdcall GetServerPath(TCHAR *OutAppPath);
  186. int __stdcall GetTimerFromAuth(TCHAR *AuthString,TCHAR *Key,DWORD *ID,TCHAR *Year,TCHAR *Month,
  187. TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Second,
  188. TCHAR *KeyPath);
  189. HWND __stdcall GetEventHwnd();
  190. void __stdcall SetEventHwnd(HWND in_hwnd);
  191. int __stdcall WritePubTimeAuthToEprom(int addr,TCHAR *W_HKey,TCHAR *W_LKey,
  192. TCHAR *PARAM1,TCHAR *PARAM2,TCHAR *PARAM3,
  193. TCHAR *PARAM4,TCHAR *PARAM5,TCHAR *PARAM6,
  194. DWORD ID,TCHAR *Year,TCHAR *Month,
  195. TCHAR *Day,TCHAR *Hour,TCHAR *Minuts,TCHAR *Sec,TCHAR *KeyPath);
  196. int __stdcall ReadPubTimeAuthFromEprom(TCHAR *PARAM1,TCHAR *PARAM2,TCHAR *PARAM3,
  197. TCHAR *PARAM4,TCHAR *PARAM5,TCHAR *PARAM6,
  198. TCHAR *OutSetTime,DWORD *id,int addr,TCHAR *R_HKey,TCHAR *R_LKey,
  199. TCHAR *KeyPath);
  200. int __stdcall WriteNetAuthToEpmEx(int Addr,TCHAR *param1,TCHAR *param2,TCHAR *param3,
  201. TCHAR *param4,TCHAR *param5,TCHAR *param6,
  202. TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
  203. int __stdcall YtReadString(TCHAR *OutString,short add,short len,TCHAR *HKey,TCHAR *LKey,TCHAR *KeyPath);
  204. short __stdcall AddConnectNew(BYTE InFunNum,short Addr,BOOL IfClose,TCHAR *OutVerfCode,TCHAR *KeyPath);
  205. }