2022-08-07 15:36:55 +08:00
|
|
|
|
[
|
2021-02-12 23:21:57 +08:00
|
|
|
|
uuid(ed838ecd-8a1e-4da7-bfda-9f2d12d07893),
|
|
|
|
|
version(1.0),
|
|
|
|
|
implicit_handle(handle_t hSpyBinding),
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
interface ISpy
|
2022-08-07 15:03:17 +08:00
|
|
|
|
{
|
2022-08-07 23:32:25 +08:00
|
|
|
|
import "oaidl.idl";
|
2022-08-07 15:03:17 +08:00
|
|
|
|
|
|
|
|
|
typedef struct RpcMessage {
|
|
|
|
|
int self; // 是否自己发的消息:0=否,1=是
|
|
|
|
|
int type; // 消息类型
|
|
|
|
|
int source; // 消息来源:0=好友消息,1=群消息
|
|
|
|
|
BSTR id; // 消息ID
|
|
|
|
|
BSTR xml; // 群其他消息
|
|
|
|
|
BSTR wxId; // 发送人微信ID
|
|
|
|
|
BSTR roomId; // 群ID
|
|
|
|
|
BSTR content; // 消息内容,MAC版最大:16384,即16KB
|
2022-08-07 23:32:25 +08:00
|
|
|
|
} RpcMessage_t;
|
|
|
|
|
|
|
|
|
|
// 模拟 map<int, wstring>
|
2022-08-07 20:08:54 +08:00
|
|
|
|
typedef struct RpcIntBstrPair {
|
2022-08-07 23:32:25 +08:00
|
|
|
|
int key;
|
2022-08-07 20:08:54 +08:00
|
|
|
|
BSTR value;
|
2022-08-07 23:32:25 +08:00
|
|
|
|
} RpcIntBstrPair_t;
|
|
|
|
|
typedef RpcIntBstrPair_t *PRpcIntBstrPair;
|
|
|
|
|
typedef RpcIntBstrPair_t **PPRpcIntBstrPair;
|
|
|
|
|
|
2022-08-07 20:50:49 +08:00
|
|
|
|
typedef struct RpcContact {
|
2022-08-07 23:32:25 +08:00
|
|
|
|
BSTR wxId; // 微信ID
|
|
|
|
|
BSTR wxCode; // 微信号
|
|
|
|
|
BSTR wxName; // 微信昵称
|
|
|
|
|
BSTR wxCountry; // 国家
|
|
|
|
|
BSTR wxProvince; // 省/州
|
|
|
|
|
BSTR wxCity; // 城市
|
|
|
|
|
BSTR wxGender; // 性别
|
|
|
|
|
} RpcContact_t;
|
|
|
|
|
typedef RpcContact_t *PRpcContact;
|
|
|
|
|
typedef RpcContact_t **PPRpcContact;
|
2021-02-12 23:21:57 +08:00
|
|
|
|
|
2022-08-07 23:49:37 +08:00
|
|
|
|
typedef struct RpcTables {
|
|
|
|
|
BSTR table; // 表名
|
|
|
|
|
BSTR sql; // 建表 SQL
|
|
|
|
|
} RpcTables_t;
|
|
|
|
|
typedef RpcTables_t *PRpcTables;
|
|
|
|
|
typedef RpcTables_t **PPRpcTables;
|
|
|
|
|
|
2022-08-20 22:10:11 +08:00
|
|
|
|
typedef struct RpcSqlResult {
|
|
|
|
|
int type;
|
|
|
|
|
BSTR column;
|
|
|
|
|
BSTR content;
|
|
|
|
|
} RpcSqlResult_t;
|
|
|
|
|
typedef RpcSqlResult_t *PRpcSqlResult;
|
|
|
|
|
typedef RpcSqlResult_t **PPRpcSqlResult;
|
|
|
|
|
typedef RpcSqlResult_t ***PPPRpcSqlResult;
|
|
|
|
|
|
2021-02-12 23:21:57 +08:00
|
|
|
|
int IsLogin();
|
2022-08-20 17:39:21 +08:00
|
|
|
|
int SendTextMsg([ in, string ] const wchar_t *wxid, [ in, string ] const wchar_t *msg,
|
|
|
|
|
[ in, unique, string ] const wchar_t *atWxids);
|
2021-08-22 21:57:16 +08:00
|
|
|
|
int SendImageMsg([ in, string ] const wchar_t *wxid, [ in, string ] const wchar_t *path);
|
2022-08-07 23:32:25 +08:00
|
|
|
|
int GetMsgTypes([out] int *pNum, [ out, size_is(, *pNum) ] PPRpcIntBstrPair *msgTypes);
|
|
|
|
|
int GetContacts([out] int *pNum, [ out, size_is(, *pNum) ] PPRpcContact *contacts);
|
|
|
|
|
int GetDbNames([out] int *pNum, [ out, size_is(, *pNum) ] BSTR **dbs);
|
2022-08-07 23:49:37 +08:00
|
|
|
|
int GetDbTables([ in, string ] const wchar_t *db, [out] int *pNum, [ out, size_is(, *pNum) ] PPRpcTables *tbls);
|
2022-08-20 22:10:11 +08:00
|
|
|
|
int ExecDbQuery([ in, string ] const wchar_t *db,
|
|
|
|
|
[ in, string ] const wchar_t *sql, [out] int *pRow, [out] int *pCol,
|
|
|
|
|
[ out, size_is(, *pRow, *pCol) ] PPPRpcSqlResult *ret);
|
2021-02-12 23:21:57 +08:00
|
|
|
|
|
|
|
|
|
void EnableReceiveMsg();
|
2022-08-20 15:15:04 +08:00
|
|
|
|
void DisableReceiveMsg();
|
2022-08-07 23:32:25 +08:00
|
|
|
|
[callback] int ReceiveMsg([in] RpcMessage_t rpcMsg);
|
2021-02-12 23:21:57 +08:00
|
|
|
|
};
|