truiken@gmail.com wrote:
@@ -362,6 +363,24 @@ */ BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid ) {
- BOOL ret;
- PNOTIFYICONDATAW p = HeapAlloc(GetProcessHeap(),0,sizeof(NOTIFYICONDATAW));
- memcpy(p, pnid, sizeof(NOTIFYICONDATAW));
- MultiByteToWideChar( CP_ACP, 0, pnid->szTip, -1, p->szTip, sizeof(p->szTip) );
MultiByteToWideChar takes number of wide characters, not bytes for the target buffer.
- p->szTip[sizeof(p->szTip)-1] = 0;
Since p->szTip is a unicode buffer you have to divide sizeof(p->szTip) by sizeof(p->szTip[0]) here.