Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

621 lines
22 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: signadv.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "global.hxx"
  11. #include <dbgdef.h>
  12. extern HINSTANCE HinstDll;
  13. extern HMODULE HmodRichEdit;
  14. static const HELPMAP helpmap[] = {
  15. {IDC_SIGNER_ADVANCED_DETAILS, IDH_SIGNERINFO_ADVANCED_DETAIL_LIST},
  16. {IDC_SIGNER_ADVANCED_VALUE, IDH_SIGNERINFO_ADVANCED_DETAIL_EDIT}
  17. };
  18. #define INDENT_STRING L" "
  19. #define TERMINATING_CHAR L""
  20. static void AddSignerInfoToList(HWND hWndListView, SIGNER_VIEW_HELPER *pviewhelp)
  21. {
  22. CMSG_SIGNER_INFO const *pSignerInfo;
  23. PCMSG_SIGNER_INFO pCounterSignerInfo;
  24. DWORD cbCounterSignerInfo;
  25. PCCERT_CONTEXT pCertContext = NULL;
  26. DWORD i;
  27. WCHAR szFieldText[_MAX_PATH]; // used for calls to LoadString only
  28. LV_ITEMW lvI;
  29. int itemIndex = 0;
  30. LPWSTR pwszText;
  31. DWORD cbFormatedAttribute;
  32. BYTE *pbFormatedAttribute;
  33. char szVersion[32];
  34. pSignerInfo = pviewhelp->pcvsi->pSignerInfo;
  35. //
  36. // set up the fields in the list view item struct that don't change from item to item
  37. //
  38. memset(&lvI, 0, sizeof(lvI));
  39. lvI.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE;
  40. lvI.state = 0;
  41. lvI.stateMask = 0;
  42. lvI.iSubItem = 0;
  43. lvI.pszText = szFieldText;
  44. //
  45. // version
  46. //
  47. LoadStringU(HinstDll, IDS_ADV_VERSION, szFieldText, ARRAYSIZE(szFieldText));
  48. wsprintfA(szVersion, "V%d", pSignerInfo->dwVersion+1);
  49. if (NULL != (pwszText = CertUIMkWStr(szVersion)))
  50. {
  51. lvI.cchTextMax = wcslen(szFieldText);
  52. lvI.lParam = (LPARAM) MakeListDisplayHelper(FALSE, pwszText, NULL, 0);
  53. lvI.iItem = itemIndex++;
  54. ListView_InsertItemU(hWndListView, &lvI);
  55. ListView_SetItemTextU(hWndListView, itemIndex-1 , 1, pwszText);
  56. }
  57. //
  58. // issuer
  59. //
  60. LoadStringU(HinstDll, IDS_ADV_ISSUER, szFieldText, ARRAYSIZE(szFieldText));
  61. lvI.cchTextMax = wcslen(szFieldText);
  62. if (FormatDNNameString(&pwszText, pSignerInfo->Issuer.pbData, pSignerInfo->Issuer.cbData, TRUE))
  63. {
  64. lvI.lParam = (LPARAM) MakeListDisplayHelper(FALSE, pwszText, NULL, 0);
  65. lvI.iItem = itemIndex++;
  66. ListView_InsertItemU(hWndListView, &lvI);
  67. if (FormatDNNameString(&pwszText, pSignerInfo->Issuer.pbData, pSignerInfo->Issuer.cbData, FALSE))
  68. {
  69. ListView_SetItemTextU(hWndListView, itemIndex-1 , 1, pwszText);
  70. free(pwszText);
  71. }
  72. }
  73. //
  74. // serial number
  75. //
  76. if (FormatSerialNoString(&pwszText, &(pSignerInfo->SerialNumber)))
  77. {
  78. LoadStringU(HinstDll, IDS_ADV_SER_NUM, szFieldText, ARRAYSIZE(szFieldText));
  79. lvI.cchTextMax = wcslen(szFieldText);
  80. lvI.lParam = (LPARAM) MakeListDisplayHelper(TRUE, pwszText, NULL, 0);
  81. lvI.iItem = itemIndex++;
  82. ListView_InsertItemU(hWndListView, &lvI);
  83. ListView_SetItemTextU(hWndListView, itemIndex-1 , 1, pwszText);
  84. }
  85. //
  86. // hash algorithm
  87. //
  88. if (FormatAlgorithmString(&pwszText, &(pSignerInfo->HashAlgorithm)))
  89. {
  90. LoadStringU(HinstDll, IDS_DIGEST_ALGORITHM, szFieldText, ARRAYSIZE(szFieldText));
  91. lvI.cchTextMax = wcslen(szFieldText);
  92. lvI.lParam = (LPARAM) MakeListDisplayHelper(FALSE, pwszText, NULL, 0);
  93. lvI.iItem = itemIndex++;
  94. ListView_InsertItemU(hWndListView, &lvI);
  95. ListView_SetItemTextU(hWndListView, itemIndex-1 , 1, pwszText);
  96. }
  97. //
  98. // hash encryption algorithm
  99. //
  100. if (FormatAlgorithmString(&pwszText, &(pSignerInfo->HashEncryptionAlgorithm)))
  101. {
  102. LoadStringU(HinstDll, IDS_DIGEST_ENCRYPTION_ALGORITHM, szFieldText, ARRAYSIZE(szFieldText));
  103. lvI.cchTextMax = wcslen(szFieldText);
  104. lvI.lParam = (LPARAM) MakeListDisplayHelper(FALSE, pwszText, NULL, 0);
  105. lvI.iItem = itemIndex++;
  106. ListView_InsertItemU(hWndListView, &lvI);
  107. ListView_SetItemTextU(hWndListView, itemIndex-1 , 1, pwszText);
  108. }
  109. //
  110. // Authenticated Attributes
  111. //
  112. if (pSignerInfo->AuthAttrs.cAttr > 0)
  113. {
  114. //
  115. // display the header
  116. //
  117. LoadStringU(HinstDll, IDS_AUTHENTICATED_ATTRIBUTES, szFieldText, ARRAYSIZE(szFieldText));
  118. lvI.cchTextMax = wcslen(szFieldText);
  119. lvI.lParam = (LPARAM) NULL;
  120. lvI.iItem = itemIndex++;
  121. lvI.iIndent = 0;
  122. ListView_InsertItemU(hWndListView, &lvI);
  123. lvI.iIndent = 2;
  124. //
  125. // display each unauthenticated attribute
  126. //
  127. for (i=0; i<pSignerInfo->AuthAttrs.cAttr; i++)
  128. {
  129. //
  130. // get the field column string
  131. //
  132. wcscpy(szFieldText, INDENT_STRING);
  133. if (!MyGetOIDInfo(
  134. &szFieldText[0] + ((sizeof(INDENT_STRING) - sizeof(TERMINATING_CHAR)) / sizeof(WCHAR)),
  135. ARRAYSIZE(szFieldText) - ((sizeof(INDENT_STRING) - sizeof(TERMINATING_CHAR)) / sizeof(WCHAR)),
  136. pSignerInfo->AuthAttrs.rgAttr[i].pszObjId))
  137. {
  138. return;
  139. }
  140. //
  141. // get the value column string
  142. //
  143. cbFormatedAttribute = 0;
  144. pbFormatedAttribute = NULL;
  145. CryptFormatObject(
  146. X509_ASN_ENCODING,
  147. 0,
  148. 0,
  149. NULL,
  150. pSignerInfo->AuthAttrs.rgAttr[i].pszObjId,
  151. pSignerInfo->AuthAttrs.rgAttr[i].rgValue[0].pbData,
  152. pSignerInfo->AuthAttrs.rgAttr[i].rgValue[0].cbData,
  153. NULL,
  154. &cbFormatedAttribute
  155. );
  156. if (NULL == (pbFormatedAttribute = (BYTE *) malloc(cbFormatedAttribute)))
  157. {
  158. return;
  159. }
  160. if (CryptFormatObject(
  161. X509_ASN_ENCODING,
  162. 0,
  163. 0,
  164. NULL,
  165. pSignerInfo->AuthAttrs.rgAttr[i].pszObjId,
  166. pSignerInfo->AuthAttrs.rgAttr[i].rgValue[0].pbData,
  167. pSignerInfo->AuthAttrs.rgAttr[i].rgValue[0].cbData,
  168. pbFormatedAttribute,
  169. &cbFormatedAttribute
  170. ))
  171. {
  172. lvI.iItem = itemIndex++;
  173. lvI.cchTextMax = wcslen(szFieldText);
  174. lvI.lParam = (LPARAM) MakeListDisplayHelperForExtension(
  175. pSignerInfo->AuthAttrs.rgAttr[i].pszObjId,
  176. pSignerInfo->AuthAttrs.rgAttr[i].rgValue[0].pbData,
  177. pSignerInfo->AuthAttrs.rgAttr[i].rgValue[0].cbData);
  178. ListView_InsertItemU(hWndListView, &lvI);
  179. ListView_SetItemTextU(
  180. hWndListView,
  181. itemIndex-1,
  182. 1,
  183. (LPWSTR)pbFormatedAttribute);
  184. }
  185. free (pbFormatedAttribute);
  186. }
  187. }
  188. //
  189. // Unauthenticated Attributes
  190. //
  191. if (pSignerInfo->UnauthAttrs.cAttr > 0)
  192. {
  193. //
  194. // display the header
  195. //
  196. LoadStringU(HinstDll, IDS_UNAUTHENTICATED_ATTRIBUTES, szFieldText, ARRAYSIZE(szFieldText));
  197. lvI.cchTextMax = wcslen(szFieldText);
  198. lvI.lParam = (LPARAM) NULL;
  199. lvI.iItem = itemIndex++;
  200. lvI.iIndent = 0;
  201. ListView_InsertItemU(hWndListView, &lvI);
  202. lvI.iIndent = 2;
  203. //
  204. // display each unauthenticated attribute
  205. //
  206. for (i=0; i<pSignerInfo->UnauthAttrs.cAttr; i++)
  207. {
  208. //
  209. // get the field column string
  210. //
  211. wcscpy(szFieldText, INDENT_STRING);
  212. if (!MyGetOIDInfo(
  213. &szFieldText[0] + ((sizeof(INDENT_STRING) - sizeof(TERMINATING_CHAR)) / sizeof(WCHAR)),
  214. ARRAYSIZE(szFieldText) - ((sizeof(INDENT_STRING) - sizeof(TERMINATING_CHAR)) / sizeof(WCHAR)),
  215. pSignerInfo->UnauthAttrs.rgAttr[i].pszObjId))
  216. {
  217. return;
  218. }
  219. //
  220. // get the value column string
  221. //
  222. cbFormatedAttribute = 0;
  223. pbFormatedAttribute = NULL;
  224. CryptFormatObject(
  225. X509_ASN_ENCODING,
  226. 0,
  227. 0,
  228. NULL,
  229. pSignerInfo->UnauthAttrs.rgAttr[i].pszObjId,
  230. pSignerInfo->UnauthAttrs.rgAttr[i].rgValue[0].pbData,
  231. pSignerInfo->UnauthAttrs.rgAttr[i].rgValue[0].cbData,
  232. NULL,
  233. &cbFormatedAttribute
  234. );
  235. if (NULL == (pbFormatedAttribute = (BYTE *) malloc(cbFormatedAttribute)))
  236. {
  237. return;
  238. }
  239. if (CryptFormatObject(
  240. X509_ASN_ENCODING,
  241. 0,
  242. 0,
  243. NULL,
  244. pSignerInfo->UnauthAttrs.rgAttr[i].pszObjId,
  245. pSignerInfo->UnauthAttrs.rgAttr[i].rgValue[0].pbData,
  246. pSignerInfo->UnauthAttrs.rgAttr[i].rgValue[0].cbData,
  247. pbFormatedAttribute,
  248. &cbFormatedAttribute
  249. ))
  250. {
  251. lvI.iItem = itemIndex++;
  252. lvI.cchTextMax = wcslen(szFieldText);
  253. lvI.lParam = (LPARAM) MakeListDisplayHelperForExtension(
  254. pSignerInfo->UnauthAttrs.rgAttr[i].pszObjId,
  255. pSignerInfo->UnauthAttrs.rgAttr[i].rgValue[0].pbData,
  256. pSignerInfo->UnauthAttrs.rgAttr[i].rgValue[0].cbData);
  257. ListView_InsertItemU(hWndListView, &lvI);
  258. ListView_SetItemTextU(
  259. hWndListView,
  260. itemIndex-1,
  261. 1,
  262. (LPWSTR)pbFormatedAttribute);
  263. }
  264. free (pbFormatedAttribute);
  265. }
  266. }
  267. }
  268. INT_PTR APIENTRY ViewPageSignerAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam,
  269. LPARAM lParam)
  270. {
  271. DWORD i;
  272. PROPSHEETPAGE *ps;
  273. SIGNER_VIEW_HELPER *pviewhelp;
  274. HWND hWndListView;
  275. LV_COLUMNW lvC;
  276. WCHAR szText[CRYPTUI_MAX_STRING_SIZE];
  277. CMSG_SIGNER_INFO const *pSignerInfo;
  278. LVITEMW lvI;
  279. LPNMLISTVIEW pnmv;
  280. WCHAR szCompareText[CRYPTUI_MAX_STRING_SIZE];
  281. HWND hwnd;
  282. BOOL fCallSetWindowLong;
  283. switch ( msg ) {
  284. case WM_INITDIALOG:
  285. //
  286. // save the pviewhelp struct in DWLP_USER so it can always be accessed
  287. //
  288. ps = (PROPSHEETPAGE *) lParam;
  289. pviewhelp = (SIGNER_VIEW_HELPER *) (ps->lParam);
  290. pSignerInfo = pviewhelp->pcvsi->pSignerInfo;
  291. SetWindowLongPtr(hwndDlg, DWLP_USER, (DWORD_PTR) pviewhelp);
  292. pviewhelp->previousSelection = -1;
  293. pviewhelp->currentSelection = -1;
  294. //
  295. // clear the text in the detail edit box
  296. //
  297. CryptUISetRicheditTextW(hwndDlg, IDC_SIGNER_ADVANCED_VALUE, L"");
  298. //
  299. // get the handle of the list view control
  300. //
  301. hWndListView = GetDlgItem(hwndDlg, IDC_SIGNER_ADVANCED_DETAILS);
  302. //
  303. // initialize the columns in the list view
  304. //
  305. lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
  306. lvC.fmt = LVCFMT_LEFT; // Left-align the column.
  307. lvC.pszText = szText; // The text for the column.
  308. // Add the columns. They are loaded from a string table.
  309. lvC.iSubItem = 0;
  310. lvC.cx = 140;
  311. LoadStringU(HinstDll, IDS_FIELD, szText, ARRAYSIZE(szText));
  312. if (ListView_InsertColumnU(hWndListView, 0, &lvC) == -1)
  313. {
  314. // error
  315. }
  316. lvC.cx = 218;
  317. LoadStringU(HinstDll, IDS_VALUE, szText, ARRAYSIZE(szText));
  318. if (ListView_InsertColumnU(hWndListView, 1, &lvC) == -1)
  319. {
  320. // error
  321. }
  322. //
  323. // set the style in the list view so that it highlights an entire line
  324. //
  325. SendMessageA(hWndListView, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
  326. //
  327. // add all of the signer information to the list box
  328. //
  329. AddSignerInfoToList(hWndListView, pviewhelp);
  330. return TRUE;
  331. case WM_NOTIFY:
  332. pviewhelp = (SIGNER_VIEW_HELPER *) GetWindowLongPtr(hwndDlg, DWLP_USER);
  333. pSignerInfo = pviewhelp->pcvsi->pSignerInfo;
  334. switch (((NMHDR FAR *) lParam)->code)
  335. {
  336. case PSN_SETACTIVE:
  337. break;
  338. case PSN_APPLY:
  339. SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LRESULT)TRUE);
  340. break;
  341. case PSN_KILLACTIVE:
  342. SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LRESULT)FALSE);
  343. return TRUE;
  344. case PSN_RESET:
  345. SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LRESULT)FALSE);
  346. break;
  347. case PSN_HELP:
  348. pviewhelp = (SIGNER_VIEW_HELPER *) GetWindowLongPtr(hwndDlg, DWLP_USER);
  349. if (FIsWin95) {
  350. //WinHelpA(hwndDlg, (LPSTR) pviewhelp->pcvsi->szHelpFileName,
  351. // HELP_CONTEXT, pviewhelp->pcvsi->dwHelpId);
  352. }
  353. else {
  354. //WinHelpW(hwndDlg, pviewhelp->pcvsi->szHelpFileName, HELP_CONTEXT,
  355. // pviewhelp->pcvsi->dwHelpId);
  356. }
  357. return TRUE;
  358. case LVN_ITEMCHANGING:
  359. pnmv = (LPNMLISTVIEW) lParam;
  360. fCallSetWindowLong = FALSE;
  361. hWndListView = GetDlgItem(hwndDlg, IDC_SIGNER_ADVANCED_DETAILS);
  362. //
  363. // if this item is being de-selected, then save it's index incase we need to
  364. // re-select it
  365. if ((pnmv->uOldState & LVIS_SELECTED) || (pnmv->uOldState & LVIS_FOCUSED))
  366. {
  367. pviewhelp->previousSelection = pnmv->iItem;
  368. }
  369. //
  370. // if the new item selected is the "Authenticated Attributes" header, or
  371. // the "Unauthenticated Attributes" header then don't allow it to be
  372. // selected
  373. //
  374. if ((pnmv->uNewState & LVIS_SELECTED) || (pnmv->uNewState & LVIS_FOCUSED))
  375. {
  376. memset(&lvI, 0, sizeof(lvI));
  377. lvI.iItem = pnmv->iItem;
  378. lvI.mask = LVIF_TEXT;
  379. lvI.pszText = szText;
  380. lvI.cchTextMax = ARRAYSIZE(szText);
  381. if (!ListView_GetItemU(hWndListView, &lvI))
  382. {
  383. return FALSE;
  384. }
  385. LoadStringU(HinstDll, IDS_AUTHENTICATED_ATTRIBUTES, szCompareText, ARRAYSIZE(szCompareText));
  386. if (wcscmp(szCompareText, szText) == 0)
  387. {
  388. if (pnmv->iItem == pviewhelp->previousSelection-1)
  389. {
  390. pviewhelp->currentSelection = pviewhelp->previousSelection-2;
  391. }
  392. else if (pnmv->iItem == pviewhelp->previousSelection+1)
  393. {
  394. pviewhelp->currentSelection = pviewhelp->previousSelection+2;
  395. }
  396. else
  397. {
  398. pviewhelp->currentSelection = pviewhelp->previousSelection;
  399. }
  400. ListView_SetItemState(
  401. GetDlgItem(hwndDlg, IDC_SIGNER_ADVANCED_DETAILS),
  402. pviewhelp->currentSelection,
  403. LVIS_SELECTED | LVIS_FOCUSED,
  404. LVIS_SELECTED | LVIS_FOCUSED);
  405. fCallSetWindowLong = TRUE;
  406. }
  407. else
  408. {
  409. LoadStringU(HinstDll, IDS_UNAUTHENTICATED_ATTRIBUTES, szCompareText, ARRAYSIZE(szCompareText));
  410. if (wcscmp(szCompareText, szText) == 0)
  411. {
  412. if (pnmv->iItem == pviewhelp->previousSelection-1)
  413. {
  414. pviewhelp->currentSelection = pviewhelp->previousSelection-2;
  415. }
  416. else if (pnmv->iItem == pviewhelp->previousSelection+1)
  417. {
  418. pviewhelp->currentSelection = pviewhelp->previousSelection+2;
  419. }
  420. else
  421. {
  422. pviewhelp->currentSelection = pviewhelp->previousSelection;
  423. }
  424. ListView_SetItemState(
  425. GetDlgItem(hwndDlg, IDC_SIGNER_ADVANCED_DETAILS),
  426. pviewhelp->currentSelection,
  427. LVIS_SELECTED | LVIS_FOCUSED,
  428. LVIS_SELECTED | LVIS_FOCUSED);
  429. fCallSetWindowLong = TRUE;
  430. }
  431. else
  432. {
  433. pviewhelp->currentSelection = pnmv->iItem;
  434. }
  435. }
  436. DisplayHelperTextInEdit(
  437. GetDlgItem(hwndDlg, IDC_SIGNER_ADVANCED_DETAILS),
  438. hwndDlg,
  439. IDC_SIGNER_ADVANCED_VALUE,
  440. pviewhelp->currentSelection);
  441. if (fCallSetWindowLong)
  442. {
  443. SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LRESULT)TRUE);
  444. }
  445. }
  446. return TRUE;
  447. case NM_CLICK:
  448. if ((((NMHDR FAR *) lParam)->idFrom) != IDC_SIGNER_ADVANCED_DETAILS)
  449. {
  450. break;
  451. }
  452. ListView_SetItemState(
  453. GetDlgItem(hwndDlg, IDC_SIGNER_ADVANCED_DETAILS),
  454. pviewhelp->currentSelection,
  455. LVIS_SELECTED | LVIS_FOCUSED,
  456. LVIS_SELECTED | LVIS_FOCUSED);
  457. DisplayHelperTextInEdit(
  458. GetDlgItem(hwndDlg, IDC_SIGNER_ADVANCED_DETAILS),
  459. hwndDlg,
  460. IDC_SIGNER_ADVANCED_VALUE,
  461. -1);
  462. break;
  463. case NM_SETFOCUS:
  464. switch (((NMHDR FAR *) lParam)->idFrom)
  465. {
  466. case IDC_SIGNER_ADVANCED_DETAILS:
  467. hWndListView = GetDlgItem(hwndDlg, IDC_SIGNER_ADVANCED_DETAILS);
  468. if ((ListView_GetItemCount(hWndListView) != 0) &&
  469. (ListView_GetNextItem(hWndListView, -1, LVNI_SELECTED) == -1))
  470. {
  471. memset(&lvI, 0, sizeof(lvI));
  472. lvI.mask = LVIF_STATE;
  473. lvI.iItem = 0;
  474. lvI.state = LVIS_FOCUSED;
  475. lvI.stateMask = LVIS_FOCUSED;
  476. ListView_SetItem(hWndListView, &lvI);
  477. }
  478. break;
  479. }
  480. break;
  481. }
  482. break;
  483. case WM_COMMAND:
  484. pviewhelp = (SIGNER_VIEW_HELPER *) GetWindowLongPtr(hwndDlg, DWLP_USER);
  485. pSignerInfo = pviewhelp->pcvsi->pSignerInfo;
  486. switch (LOWORD(wParam))
  487. {
  488. case IDHELP:
  489. if (FIsWin95) {
  490. //WinHelpA(hwndDlg, (LPSTR) pviewhelp->pcvsi->szHelpFileName,
  491. // HELP_CONTEXT, pviewhelp->pcvsi->dwHelpId);
  492. }
  493. else {
  494. //WinHelpW(hwndDlg, pviewhelp->pcvsi->szHelpFileName, HELP_CONTEXT,
  495. // pviewhelp->pcvsi->dwHelpId);
  496. }
  497. return TRUE;
  498. }
  499. break;
  500. case WM_DESTROY:
  501. pviewhelp = (SIGNER_VIEW_HELPER *) GetWindowLongPtr(hwndDlg, DWLP_USER);
  502. //
  503. // get all the items in the list view and free the lParam
  504. // associated with each of them (lParam is the helper sruct)
  505. //
  506. hWndListView = GetDlgItem(hwndDlg, IDC_SIGNER_ADVANCED_DETAILS);
  507. memset(&lvI, 0, sizeof(lvI));
  508. lvI.iItem = ListView_GetItemCount(hWndListView) - 1;
  509. lvI.mask = LVIF_PARAM;
  510. while (lvI.iItem >= 0)
  511. {
  512. if (ListView_GetItemU(hWndListView, &lvI))
  513. {
  514. FreeListDisplayHelper((PLIST_DISPLAY_HELPER) lvI.lParam);
  515. }
  516. lvI.iItem--;
  517. }
  518. break;
  519. case WM_HELP:
  520. case WM_CONTEXTMENU:
  521. if (msg == WM_HELP)
  522. {
  523. hwnd = GetDlgItem(hwndDlg, ((LPHELPINFO)lParam)->iCtrlId);
  524. }
  525. else
  526. {
  527. hwnd = (HWND) wParam;
  528. }
  529. if ((hwnd != GetDlgItem(hwndDlg, IDC_SIGNER_ADVANCED_DETAILS)) &&
  530. (hwnd != GetDlgItem(hwndDlg, IDC_SIGNER_ADVANCED_VALUE)))
  531. {
  532. SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LRESULT)TRUE);
  533. return TRUE;
  534. }
  535. else
  536. {
  537. return OnContextHelp(hwndDlg, msg, wParam, lParam, helpmap);
  538. }
  539. }
  540. return FALSE;
  541. }