现在的位置: 首页 > 综合 > 正文

ActiveSync Research Update

2012年05月29日 ⁄ 综合 ⁄ 共 13259字 ⁄ 字号 评论关闭
 

我也把自己的research update一下。

现在的一个问题就是PPC上还是比较模糊,我准备先写个方便检测的tool

下面是我的操作的log蓝色字体是原版的工具log红色字体是自己的一些分析,后面附了一些代码定义,方便理解。

 

 

 

 

 

 

 

 

删除一条记录:

Id: 128, Provider: MS.WinCE.StockPor2, Interface: IReplNotify, Function: OnItemNotify(), Params: (uCode: 3, lpszProgId: MS.WinCE.StockPor2, lpszName: StockPor, hItem:  0x2334a98, ulFlags: 0), Time: 0.0000383, Return: 0 

删除纪录后,立刻就调用这个函数了。同样的问题,谁来告诉ActiveSync Manager,我删出记录了?uCode: 3 可以代码里是#define RNC_DELETED 3 lpszProgIdlpszName应该是注册表里读出来的, hItem的类型是HREPLITEM,其中包含着uid,应该是唯一的 x2334a98这个数字下面都用到了就可以代表这个Item, ulFlags:始终是0没意义

Id: 128, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x23348e0, hItem2:  0x2334a98), Time: 0.0001229, Return: -1

Id: 129, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x2334960, hItem2:  0x2334a98), Time: 0.0001461, Return: -1

Id: 131, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x23349a0, hItem2:  0x2334a98), Time: 0.0001528, Return: -1

Id: 132, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x2334760, hItem2:  0x2334a98), Time: 0.0001400, Return: 0

可以看到这里在比较,hItem2:  0x2334a98就是我删除的ItemhItem1我推测是device端的HREPLITEM,因为后面的ReportStatus0x2334760传给了PPC,前面几次都返回-1,没找到,最后一次,返回0,找到相等的 Item(uid相等)

Id: 133, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: FreeObject(), Params: (hObject:  0x2334a98), Time: 0.0001726, Return: 0

Free我删除的Object

Id: 134, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23349a0, lpb:          0), Time: 0.0021533, Return: 17

Id: 135, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334960, lpb:          0), Time: 0.0001475, Return: 17

Id: 136, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334920, lpb:          0), Time: 0.0001355, Return: 17

Id: 137, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348e0, lpb:          0), Time: 0.0001394, Return: 17

Id: 138, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348a0, lpb:          0), Time: 0.0001372, Return: 17

Id: 139, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334860, lpb:          0), Time: 0.0001467, Return: 17

Id: 140, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334820, lpb:          0), Time: 0.0001347, Return: 17

Id: 141, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23347e0, lpb:          0), Time: 0.0001374, Return: 17

Id: 142, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23347a0, lpb:          0), Time: 0.0001347, Return: 17

Id: 143, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334760, lpb:          0), Time: 0.0001391, Return: 17

Id: 144, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23349a0, lpb:   0xc59bce), Time: 0.0001383, Return: 17

Id: 145, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334960, lpb:   0xc59be9), Time: 0.0001380, Return: 17

Id: 146, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334920, lpb:   0xc59c04), Time: 0.0001405, Return: 17

Id: 147, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348e0, lpb:   0xc59c1f), Time: 0.0001358, Return: 17

Id: 148, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348a0, lpb:   0xc59c3a), Time: 0.0001361, Return: 17

Id: 149, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334860, lpb:   0xc59c55), Time: 0.0011309, Return: 17

Id: 150, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334820, lpb:   0xc59c70), Time: 0.0001352, Return: 17

Id: 151, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23347e0, lpb:   0xc59c8b), Time: 0.0001394, Return: 17

Id: 152, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23347a0, lpb:   0xc59ca6), Time: 0.0001394, Return: 17

Id: 153, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334760, lpb:   0xc59cc1), Time: 0.0001416, Return: 17

对于这里进行这么多次的ObjectToBytes,我还没想到为什么。

Id: 154, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ReportStatus(), Params: (hFolder:   0, hItem: 0, uStatus: 7, uParam: 0), Time: 0.0001145, Return: 0

uStatus: 7,代码里是RSC_REMOTE_SYNC 

Id: 155, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: IsFolderChanged(), Params: (hFolder:  0x2334728, *pfChanged: 0), Time: 0.0000497, Return: 0

Folder没有发生变化

Id: 156, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ReportStatus(), Params: (hFolder: 0, hItem: 0, uStatus: 1, uParam: 5), Time: 0.0001411, Return: 0

uStatus:1,代码里是RSC_BEGIN_SYNC      

Id: 157, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: IsFolderChanged(), Params: (hFolder:  0x2334728, *pfChanged: 0), Time: 0.0001352, Return: 0

Folder没有发生变化

Id: 158, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ReportStatus(), Params: (hFolder:  0x2334728, hItem: 0, uStatus: 9, uParam: 12929912), Time: 0.0000989, Return: 0

Id: 159, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ReportStatus(), Params: (hFolder:  0x2334728, hItem:  0x2334760, uStatus: 19, uParam: 1307708), Time: 0.0001386, Return: 0

Id: 160, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ReportStatus(), Params: (hFolder:  0x2334728, hItem: 0, uStatus: 10, uParam: 0), Time: 0.0001377, Return: 0

Id: 161, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ReportStatus(), Params: (hFolder: 0, hItem: 0, uStatus: 7, uParam: 0), Time: 0.0001344, Return: 0

Id: 162, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ReportStatus(), Params: (hFolder: 0, hItem:  0, uStatus: 2, uParam: 0), Time: 0.0000497, Return: 0

从上面的ReportStatus中的uStatus代码可以猜出Activesync manager正在把删除这个事情告诉ppc,并进行了一些操作

Id: 163, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: FreeObject(), Params: (hObject:  0x2334760), Time: 0.0001648, Return: 0

把本地的对应删除的Item的映射去掉

Id: 164, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23349a0, lpb:          0), Time: 0.0001344, Return: 17

Id: 165, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334960, lpb:          0), Time: 0.0001425, Return: 17

Id: 166, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334920, lpb:          0), Time: 0.0001380, Return: 17

Id: 167, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348e0, lpb:          0), Time: 0.0001430, Return: 17

Id: 168, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348a0, lpb:          0), Time: 0.0001310, Return: 17

Id: 169, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334860, lpb:          0), Time: 0.0001444, Return: 17

Id: 170, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334820, lpb:          0), Time: 0.0001377, Return: 17

Id: 171, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23347e0, lpb:          0), Time: 0.0001330, Return: 17

Id: 172, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23347a0, lpb:          0), Time: 0.0001344, Return: 17

Id: 173, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23349a0, lpb:   0xc55a8e), Time: 0.0001366, Return: 17

Id: 174, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334960, lpb:   0xc55aa9), Time: 0.0001363, Return: 17

Id: 175, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334920, lpb:   0xc55ac4), Time: 0.0001349, Return: 17

Id: 176, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348e0, lpb:   0xc55adf), Time: 0.0001436, Return: 17

Id: 177, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348a0, lpb:   0xc55afa), Time: 0.0001374, Return: 17

Id: 178, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334860, lpb:   0xc55b15), Time: 0.0000992, Return: 17

Id: 179, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334820, lpb:   0xc55b30), Time: 0.0001299, Return: 17

Id: 180, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23347e0, lpb:   0xc55b4b), Time: 0.0001341, Return: 17

Id: 181, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23347a0, lpb:   0xc55b66), Time: 0.0001006, Return: 17

又来了好多的ObjectToBytes

Over!

 

 

添加一条记录:

Id: 232, Provider: MS.WinCE.StockPor2, Interface: IReplNotify, Function: OnItemNotify(), Params: (uCode: 2, lpszProgId: MS.WinCE.StockPor2, lpszName: StockPor, hItem:  0x23349a0, ulFlags: 0), Time: 0.0000383, Return: 0

uCode: 2 代码里是RNC_MODIFIED,其他和上面一样

Id: 232, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x23348a0, hItem2:  0x23349a0), Time: 0.0001321, Return: -1

Id: 234, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x2334920, hItem2:  0x23349a0), Time: 0.0001377, Return: -1

Id: 235, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x2334960, hItem2:  0x23349a0), Time: 0.0001374, Return: -1

Id: 236, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x2334960, hItem2:  0x23349a0), Time: 0.0001363, Return: -1

Id: 237, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x23348a0, hItem2:  0x23349a0), Time: 0.0001428, Return: -1

Id: 238, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x2334920, hItem2:  0x23349a0), Time: 0.0001433, Return: -1

Id: 239, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x2334960, hItem2:  0x23349a0), Time: 0.0001349, Return: -1

Id: 240, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x2334960, hItem2:  0x23349a0), Time: 0.0001422, Return: -1

Id: 241, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x23348a0, hItem2:  0x23349a0), Time: 0.0001405, Return: -1

Id: 242, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x2334920, hItem2:  0x23349a0), Time: 0.0001394, Return: -1

Id: 243, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: CompareItem(), Params: (hItem1:  0x2334960, hItem2:  0x23349a0), Time: 0.0001366, Return: -1

我觉得这里的比较是在看新创建的与已有的比较,当然不可能有一样的,所有都返回-1,但数据库里只有9条记录,我不知道为什么比较了10次。

Id: 244, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: IsItemReplicated(), Params: (hFolder:  0x2334728, hItem:  0x23349a0), Time: 0.0001754, Return: 1

check if pItem should be replicated using information stored both in pFolder & pItem

Id: 245, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23349a0, lpb:          0), Time: 0.0001414, Return: 17

Id: 246, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334960, lpb:          0), Time: 0.0001419, Return: 17

Id: 247, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334920, lpb:          0), Time: 0.0001408, Return: 17

Id: 248, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348e0, lpb:          0), Time: 0.0001383, Return: 17

Id: 249, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348a0, lpb:          0), Time: 0.0001405, Return: 17

Id: 250, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334860, lpb:          0), Time: 0.0001562, Return: 17

Id: 251, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334820, lpb:          0), Time: 0.0001430, Return: 17

Id: 252, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23347e0, lpb:          0), Time: 0.0001408, Return: 17

Id: 253, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23347a0, lpb:          0), Time: 0.0001458, Return: 17

Id: 254, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23349a0, lpb:   0xc55a8e), Time: 0.0001358, Return: 17

Id: 255, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334960, lpb:   0xc55aa9), Time: 0.0001067, Return: 17

Id: 256, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334920, lpb:   0xc55ac4), Time: 0.0001514, Return: 17

Id: 257, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348e0, lpb:   0xc55adf), Time: 0.0001467, Return: 17

Id: 258, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x23348a0, lpb:   0xc55afa), Time: 0.0001422, Return: 17

Id: 259, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334860, lpb:   0xc55b15), Time: 0.0001447, Return: 17

Id: 260, Provider: MS.WinCE.StockPor2, Interface: IReplStore, Function: ObjectToBytes(), Params: (hObject:  0x2334820, lpb:

抱歉!评论已关闭.