Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
63be2a03
Commit
63be2a03
authored
Dec 18, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Dec 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptui: Show cert when it's double-clicked in the hierarchy page.
parent
93f4c49e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
44 deletions
+64
-44
main.c
dlls/cryptui/main.c
+64
-44
No files found.
dlls/cryptui/main.c
View file @
63be2a03
...
@@ -1866,13 +1866,58 @@ static void show_cert_hierarchy(HWND hwnd, struct hierarchy_data *data)
...
@@ -1866,13 +1866,58 @@ static void show_cert_hierarchy(HWND hwnd, struct hierarchy_data *data)
set_certificate_status_for_end_cert
(
hwnd
,
data
->
pCertViewInfo
);
set_certificate_status_for_end_cert
(
hwnd
,
data
->
pCertViewInfo
);
}
}
static
void
show_dialog_for_selected_cert
(
HWND
hwnd
)
{
HWND
tree
=
GetDlgItem
(
hwnd
,
IDC_CERTPATH
);
TVITEMW
item
;
struct
hierarchy_data
*
data
;
DWORD
selection
;
memset
(
&
item
,
0
,
sizeof
(
item
));
item
.
mask
=
TVIF_HANDLE
|
TVIF_PARAM
;
item
.
hItem
=
(
HTREEITEM
)
SendMessageW
(
tree
,
TVM_GETNEXTITEM
,
TVGN_CARET
,
(
LPARAM
)
NULL
);
SendMessageW
(
tree
,
TVM_GETITEMW
,
0
,
(
LPARAM
)
&
item
);
data
=
get_hierarchy_data_from_tree_item
(
tree
,
item
.
hItem
);
selection
=
lparam_to_index
(
data
,
item
.
lParam
);
if
(
selection
!=
0
)
{
CRYPT_PROVIDER_SGNR
*
provSigner
;
CRYPTUI_VIEWCERTIFICATE_STRUCTW
viewInfo
;
BOOL
changed
=
FALSE
;
provSigner
=
WTHelperGetProvSignerFromChain
(
(
CRYPT_PROVIDER_DATA
*
)
data
->
pCertViewInfo
->
u
.
pCryptProviderData
,
data
->
pCertViewInfo
->
idxSigner
,
data
->
pCertViewInfo
->
fCounterSigner
,
data
->
pCertViewInfo
->
idxCounterSigner
);
memset
(
&
viewInfo
,
0
,
sizeof
(
viewInfo
));
viewInfo
.
dwSize
=
sizeof
(
viewInfo
);
viewInfo
.
dwFlags
=
data
->
pCertViewInfo
->
dwFlags
;
viewInfo
.
szTitle
=
data
->
pCertViewInfo
->
szTitle
;
viewInfo
.
pCertContext
=
provSigner
->
pasCertChain
[
selection
].
pCert
;
viewInfo
.
cStores
=
data
->
pCertViewInfo
->
cStores
;
viewInfo
.
rghStores
=
data
->
pCertViewInfo
->
rghStores
;
viewInfo
.
cPropSheetPages
=
data
->
pCertViewInfo
->
cPropSheetPages
;
viewInfo
.
rgPropSheetPages
=
data
->
pCertViewInfo
->
rgPropSheetPages
;
viewInfo
.
nStartPage
=
data
->
pCertViewInfo
->
nStartPage
;
CryptUIDlgViewCertificateW
(
&
viewInfo
,
&
changed
);
if
(
changed
)
{
/* Delete the contents of the tree */
SendMessageW
(
tree
,
TVM_DELETEITEM
,
0
,
(
LPARAM
)
TVI_ROOT
);
/* Reinitialize the tree */
show_cert_hierarchy
(
hwnd
,
data
);
}
}
}
static
LRESULT
CALLBACK
hierarchy_dlg_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
static
LRESULT
CALLBACK
hierarchy_dlg_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
LPARAM
lp
)
{
{
PROPSHEETPAGEW
*
page
;
PROPSHEETPAGEW
*
page
;
struct
hierarchy_data
*
data
;
struct
hierarchy_data
*
data
;
HWND
tree
=
GetDlgItem
(
hwnd
,
IDC_CERTPATH
);
LRESULT
ret
=
0
;
DWORD
selection
;
TRACE
(
"(%p, %08x, %08lx, %08lx)
\n
"
,
hwnd
,
msg
,
wp
,
lp
);
TRACE
(
"(%p, %08x, %08lx, %08lx)
\n
"
,
hwnd
,
msg
,
wp
,
lp
);
...
@@ -1885,13 +1930,18 @@ static LRESULT CALLBACK hierarchy_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
...
@@ -1885,13 +1930,18 @@ static LRESULT CALLBACK hierarchy_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
break
;
break
;
case
WM_NOTIFY
:
case
WM_NOTIFY
:
{
{
NMTREEVIEWW
*
nm
;
NMHDR
*
hdr
;
CRYPT_PROVIDER_SGNR
*
provSigner
;
nm
=
(
NMTREEVIEWW
*
)
lp
;
hdr
=
(
NMHDR
*
)
lp
;
switch
(
nm
->
hdr
.
code
)
switch
(
hdr
->
code
)
{
{
case
TVN_SELCHANGEDW
:
case
TVN_SELCHANGEDW
:
{
NMTREEVIEWW
*
nm
=
(
NMTREEVIEWW
*
)
lp
;
HWND
tree
=
GetDlgItem
(
hwnd
,
IDC_CERTPATH
);
DWORD
selection
;
CRYPT_PROVIDER_SGNR
*
provSigner
;
data
=
get_hierarchy_data_from_tree_item
(
tree
,
nm
->
itemNew
.
hItem
);
data
=
get_hierarchy_data_from_tree_item
(
tree
,
nm
->
itemNew
.
hItem
);
selection
=
lparam_to_index
(
data
,
nm
->
itemNew
.
lParam
);
selection
=
lparam_to_index
(
data
,
nm
->
itemNew
.
lParam
);
provSigner
=
WTHelperGetProvSignerFromChain
(
provSigner
=
WTHelperGetProvSignerFromChain
(
...
@@ -1904,54 +1954,24 @@ static LRESULT CALLBACK hierarchy_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
...
@@ -1904,54 +1954,24 @@ static LRESULT CALLBACK hierarchy_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
&
provSigner
->
pasCertChain
[
selection
]);
&
provSigner
->
pasCertChain
[
selection
]);
break
;
break
;
}
}
case
NM_DBLCLK
:
show_dialog_for_selected_cert
(
hwnd
);
SetWindowLongPtrW
(
hwnd
,
DWLP_MSGRESULT
,
1
);
ret
=
1
;
break
;
}
break
;
break
;
}
}
case
WM_COMMAND
:
case
WM_COMMAND
:
switch
(
wp
)
switch
(
wp
)
{
{
case
IDC_VIEWCERTIFICATE
:
case
IDC_VIEWCERTIFICATE
:
{
show_dialog_for_selected_cert
(
hwnd
);
TVITEMW
item
;
CRYPT_PROVIDER_SGNR
*
provSigner
;
CRYPTUI_VIEWCERTIFICATE_STRUCTW
viewInfo
;
BOOL
changed
=
FALSE
;
memset
(
&
item
,
0
,
sizeof
(
item
));
item
.
mask
=
TVIF_HANDLE
|
TVIF_PARAM
;
item
.
hItem
=
(
HTREEITEM
)
SendMessageW
(
tree
,
TVM_GETNEXTITEM
,
TVGN_CARET
,
(
LPARAM
)
NULL
);
SendMessageW
(
tree
,
TVM_GETITEMW
,
0
,
(
LPARAM
)
&
item
);
data
=
get_hierarchy_data_from_tree_item
(
tree
,
item
.
hItem
);
selection
=
lparam_to_index
(
data
,
item
.
lParam
);
provSigner
=
WTHelperGetProvSignerFromChain
(
(
CRYPT_PROVIDER_DATA
*
)
data
->
pCertViewInfo
->
u
.
pCryptProviderData
,
data
->
pCertViewInfo
->
idxSigner
,
data
->
pCertViewInfo
->
fCounterSigner
,
data
->
pCertViewInfo
->
idxCounterSigner
);
memset
(
&
viewInfo
,
0
,
sizeof
(
viewInfo
));
viewInfo
.
dwSize
=
sizeof
(
viewInfo
);
viewInfo
.
dwFlags
=
data
->
pCertViewInfo
->
dwFlags
;
viewInfo
.
szTitle
=
data
->
pCertViewInfo
->
szTitle
;
viewInfo
.
pCertContext
=
provSigner
->
pasCertChain
[
selection
].
pCert
;
viewInfo
.
cStores
=
data
->
pCertViewInfo
->
cStores
;
viewInfo
.
rghStores
=
data
->
pCertViewInfo
->
rghStores
;
viewInfo
.
cPropSheetPages
=
data
->
pCertViewInfo
->
cPropSheetPages
;
viewInfo
.
rgPropSheetPages
=
data
->
pCertViewInfo
->
rgPropSheetPages
;
viewInfo
.
nStartPage
=
data
->
pCertViewInfo
->
nStartPage
;
CryptUIDlgViewCertificateW
(
&
viewInfo
,
&
changed
);
if
(
changed
)
{
/* Delete the contents of the tree */
SendMessageW
(
tree
,
TVM_DELETEITEM
,
0
,
(
LPARAM
)
TVI_ROOT
);
/* Reinitialize the tree */
show_cert_hierarchy
(
hwnd
,
data
);
}
break
;
break
;
}
}
}
break
;
break
;
}
}
return
0
;
return
ret
;
}
}
static
UINT
CALLBACK
hierarchy_callback
(
HWND
hwnd
,
UINT
msg
,
static
UINT
CALLBACK
hierarchy_callback
(
HWND
hwnd
,
UINT
msg
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment