+ else // if cbSize == NOTIFYICONDATAW_V1_SIZE or something else
+ {
+ if (cbSize != NOTIFYICONDATAW_V1_SIZE)
+ {
+ WARN("Invalid cbSize (%d) - using only Win95 fields (size=%d)\n",
+ cbSize, NOTIFYICONDATAW_V1_SIZE);
+ cbSize = NOTIFYICONDATAW_V1_SIZE;
+ }
+ }
+
+ /* Build the data structure */
+ ZeroMemory(&tnid, sizeof(tnid));
+ tnid.dwSignature = NI_NOTIFY_SIG;
+ tnid.dwMessage = dwMessage;
+
+ /* Copy only the needed data, everything else is zeroed out */
+ CopyMemory(&tnid.nid, pnid, cbSize);
+ /* Adjust the size (the NOTIFYICONDATA structure is the full-fledged one) and the flags */
+ tnid.nid.cbSize = sizeof(tnid.nid);
+ tnid.nid.uFlags &= dwValidFlags;
+
+ /* Be sure the szTip member (that could be cut-off) is correctly NULL-terminated */
+ if (tnid.nid.uFlags & NIF_TIP)
+ {
+ if (cbSize <= NOTIFYICONDATAW_V1_SIZE)
+ {
+#define NIDV1_TIP_SIZE_W (NOTIFYICONDATAW_V1_SIZE - FIELD_OFFSET(NOTIFYICONDATAW, szTip))/sizeof(WCHAR)
+ tnid.nid.szTip[NIDV1_TIP_SIZE_W - 1] = 0;
+#undef NIDV1_TIP_SIZE_W
+ }
+ else
+ {
+ tnid.nid.szTip[_countof(tnid.nid.szTip) - 1] = 0;
+ }
+ }
+
+ /* Be sure the info strings are correctly NULL-terminated */
+ if (tnid.nid.uFlags & NIF_INFO)
+ {
+ tnid.nid.szInfo[_countof(tnid.nid.szInfo) - 1] = 0;
+ tnid.nid.szInfoTitle[_countof(tnid.nid.szInfoTitle) - 1] = 0;
+ }
+
+ /* Send the data */
+ data.dwData = 1;
+ data.cbData = sizeof(tnid);
+ data.lpData = &tnid;
+ if (SendMessageW(hShellTrayWnd, WM_COPYDATA, (WPARAM)pnid->hWnd, (LPARAM)&data))
+ ret = TRUE;