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
1d590601
Commit
1d590601
authored
Jan 07, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Jan 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptui: Show names of stores certificate manager dialog.
parent
96d0e636
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
7 deletions
+69
-7
main.c
dlls/cryptui/main.c
+69
-7
No files found.
dlls/cryptui/main.c
View file @
1d590601
...
...
@@ -109,6 +109,71 @@ static void initialize_purpose_selection(HWND hwnd)
SendMessageW
(
cb
,
CB_SETCURSEL
,
0
,
0
);
}
static
const
WCHAR
my
[]
=
{
'M'
,
'y'
,
0
};
static
const
WCHAR
addressBook
[]
=
{
'A'
,
'd'
,
'd'
,
'r'
,
'e'
,
's'
,
's'
,
'B'
,
'o'
,
'o'
,
'k'
,
0
};
static
const
WCHAR
ca
[]
=
{
'C'
,
'A'
,
0
};
static
const
WCHAR
root
[]
=
{
'R'
,
'o'
,
'o'
,
't'
,
0
};
static
const
WCHAR
trustedPublisher
[]
=
{
'T'
,
'r'
,
'u'
,
's'
,
't'
,
'e'
,
'd'
,
'P'
,
'u'
,
'b'
,
'l'
,
'i'
,
's'
,
'h'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
disallowed
[]
=
{
'D'
,
'i'
,
's'
,
'a'
,
'l'
,
'l'
,
'o'
,
'w'
,
'e'
,
'd'
,
0
};
static
LPCWSTR
defaultStoreList
[]
=
{
my
,
addressBook
,
ca
,
root
,
trustedPublisher
,
disallowed
};
static
LPCWSTR
publisherStoreList
[]
=
{
root
,
trustedPublisher
,
disallowed
};
static
void
show_cert_stores
(
HWND
hwnd
,
DWORD
dwFlags
)
{
LPCWSTR
*
storeList
;
int
cStores
,
i
;
HWND
tab
=
GetDlgItem
(
hwnd
,
IDC_MGR_STORES
);
if
(
dwFlags
&
CRYPTUI_CERT_MGR_PUBLISHER_TAB
)
{
storeList
=
publisherStoreList
;
cStores
=
sizeof
(
publisherStoreList
)
/
sizeof
(
publisherStoreList
[
0
]);
}
else
{
storeList
=
defaultStoreList
;
cStores
=
sizeof
(
defaultStoreList
)
/
sizeof
(
defaultStoreList
[
0
]);
}
if
(
dwFlags
&
CRYPTUI_CERT_MGR_SINGLE_TAB_FLAG
)
cStores
=
1
;
for
(
i
=
0
;
i
<
cStores
;
i
++
)
{
LPCWSTR
name
;
TCITEMW
item
;
HCERTSTORE
store
;
if
(
!
(
name
=
CryptFindLocalizedName
(
storeList
[
i
])))
name
=
storeList
[
i
];
store
=
CertOpenStore
(
CERT_STORE_PROV_SYSTEM_W
,
0
,
0
,
CERT_SYSTEM_STORE_CURRENT_USER
,
storeList
[
i
]);
item
.
mask
=
TCIF_TEXT
|
TCIF_PARAM
;
item
.
pszText
=
(
LPWSTR
)
name
;
item
.
lParam
=
(
LPARAM
)
store
;
SendMessageW
(
tab
,
TCM_INSERTITEMW
,
i
,
(
LPARAM
)
&
item
);
}
}
static
HCERTSTORE
cert_mgr_index_to_store
(
HWND
tab
,
int
index
)
{
TCITEMW
item
;
item
.
mask
=
TCIF_PARAM
;
SendMessageW
(
tab
,
TCM_GETITEMW
,
index
,
(
LPARAM
)
&
item
);
return
(
HCERTSTORE
)
item
.
lParam
;
}
static
void
close_stores
(
HWND
tab
)
{
int
i
,
tabs
=
SendMessageW
(
tab
,
TCM_GETITEMCOUNT
,
0
,
0
);
for
(
i
=
0
;
i
<
tabs
;
i
++
)
CertCloseStore
(
cert_mgr_index_to_store
(
tab
,
i
),
0
);
}
static
LRESULT
CALLBACK
cert_mgr_dlg_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
...
...
@@ -124,12 +189,14 @@ static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
if
(
pCryptUICertMgr
->
pwszTitle
)
SendMessageW
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
pCryptUICertMgr
->
pwszTitle
);
show_cert_stores
(
hwnd
,
pCryptUICertMgr
->
dwFlags
);
break
;
}
case
WM_COMMAND
:
switch
(
wp
)
{
case
IDCANCEL
:
close_stores
(
GetDlgItem
(
hwnd
,
IDC_MGR_STORES
));
EndDialog
(
hwnd
,
IDCANCEL
);
break
;
}
...
...
@@ -3471,15 +3538,12 @@ static BOOL is_ca_cert(PCCERT_CONTEXT cert, BOOL defaultIfNotSpecified)
static
HCERTSTORE
choose_store_for_cert
(
PCCERT_CONTEXT
cert
)
{
static
const
WCHAR
AddressBook
[]
=
{
'A'
,
'd'
,
'd'
,
'r'
,
'e'
,
's'
,
's'
,
'B'
,
'o'
,
'o'
,
'k'
,
0
};
static
const
WCHAR
CA
[]
=
{
'C'
,
'A'
,
0
};
LPCWSTR
storeName
;
if
(
is_ca_cert
(
cert
,
TRUE
))
storeName
=
CA
;
storeName
=
ca
;
else
storeName
=
A
ddressBook
;
storeName
=
a
ddressBook
;
return
CertOpenStore
(
CERT_STORE_PROV_SYSTEM_W
,
0
,
0
,
CERT_SYSTEM_STORE_CURRENT_USER
,
storeName
);
}
...
...
@@ -3522,8 +3586,6 @@ static BOOL import_crl(PCCRL_CONTEXT crl, HCERTSTORE hDestCertStore)
if
(
hDestCertStore
)
store
=
hDestCertStore
;
else
{
static
const
WCHAR
ca
[]
=
{
'C'
,
'A'
,
0
};
if
(
!
(
store
=
CertOpenStore
(
CERT_STORE_PROV_SYSTEM_W
,
0
,
0
,
CERT_SYSTEM_STORE_CURRENT_USER
,
ca
)))
{
...
...
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