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
06505e53
Commit
06505e53
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: Add known usages to certificate manager dialog's advanced dialog.
parent
7675bf42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
36 deletions
+70
-36
main.c
dlls/cryptui/main.c
+70
-36
No files found.
dlls/cryptui/main.c
View file @
06505e53
...
...
@@ -298,18 +298,86 @@ static void refresh_store_certs(HWND hwnd)
show_store_certs
(
hwnd
,
cert_mgr_current_store
(
hwnd
));
}
typedef
enum
{
CheckBitmapIndexUnchecked
=
1
,
CheckBitmapIndexChecked
=
2
,
CheckBitmapIndexDisabledUnchecked
=
3
,
CheckBitmapIndexDisabledChecked
=
4
}
CheckBitmapIndex
;
static
void
add_known_usage
(
HWND
lv
,
PCCRYPT_OID_INFO
info
,
CheckBitmapIndex
state
)
{
LVITEMW
item
;
item
.
mask
=
LVIF_TEXT
|
LVIF_STATE
|
LVIF_PARAM
;
item
.
state
=
INDEXTOSTATEIMAGEMASK
(
state
);
item
.
stateMask
=
LVIS_STATEIMAGEMASK
;
item
.
iItem
=
SendMessageW
(
lv
,
LVM_GETITEMCOUNT
,
0
,
0
);
item
.
iSubItem
=
0
;
item
.
lParam
=
(
LPARAM
)
info
;
item
.
pszText
=
(
LPWSTR
)
info
->
pwszName
;
SendMessageW
(
lv
,
LVM_INSERTITEMW
,
0
,
(
LPARAM
)
&
item
);
}
extern
BOOL
WINAPI
WTHelperGetKnownUsages
(
DWORD
action
,
PCCRYPT_OID_INFO
**
usages
);
static
void
add_known_usages_to_list
(
HWND
lv
,
CheckBitmapIndex
state
)
{
PCCRYPT_OID_INFO
*
usages
;
if
(
WTHelperGetKnownUsages
(
1
,
&
usages
))
{
PCCRYPT_OID_INFO
*
ptr
;
for
(
ptr
=
usages
;
*
ptr
;
ptr
++
)
add_known_usage
(
lv
,
*
ptr
,
state
);
WTHelperGetKnownUsages
(
2
,
&
usages
);
}
}
static
LRESULT
CALLBACK
cert_mgr_advanced_dlg_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
switch
(
msg
)
{
case
WM_INITDIALOG
:
{
RECT
rc
;
LVCOLUMNW
column
;
HWND
lv
=
GetDlgItem
(
hwnd
,
IDC_CERTIFICATE_USAGES
);
HIMAGELIST
imageList
;
GetWindowRect
(
lv
,
&
rc
);
column
.
mask
=
LVCF_WIDTH
;
column
.
cx
=
rc
.
right
-
rc
.
left
;
SendMessageW
(
lv
,
LVM_INSERTCOLUMNW
,
0
,
(
LPARAM
)
&
column
);
imageList
=
ImageList_Create
(
16
,
16
,
ILC_COLOR4
|
ILC_MASK
,
4
,
0
);
if
(
imageList
)
{
HBITMAP
bmp
;
COLORREF
backColor
=
RGB
(
255
,
0
,
255
);
bmp
=
LoadBitmapW
(
hInstance
,
MAKEINTRESOURCEW
(
IDB_CHECKS
));
ImageList_AddMasked
(
imageList
,
bmp
,
backColor
);
DeleteObject
(
bmp
);
ImageList_SetBkColor
(
imageList
,
CLR_NONE
);
SendMessageW
(
lv
,
LVM_SETIMAGELIST
,
LVSIL_STATE
,
(
LPARAM
)
imageList
);
SetWindowLongPtrW
(
hwnd
,
DWLP_USER
,
(
LPARAM
)
imageList
);
}
add_known_usages_to_list
(
lv
,
CheckBitmapIndexChecked
);
break
;
}
case
WM_COMMAND
:
switch
(
wp
)
{
case
IDOK
:
ImageList_Destroy
((
HIMAGELIST
)
GetWindowLongPtrW
(
hwnd
,
DWLP_USER
));
EndDialog
(
hwnd
,
IDOK
);
break
;
case
IDCANCEL
:
ImageList_Destroy
((
HIMAGELIST
)
GetWindowLongPtrW
(
hwnd
,
DWLP_USER
));
EndDialog
(
hwnd
,
IDCANCEL
);
break
;
}
...
...
@@ -2232,13 +2300,6 @@ static void create_cert_details_list(HWND hwnd, struct detail_data *data)
set_fields_selection
(
hwnd
,
data
,
0
);
}
typedef
enum
{
CheckBitmapIndexUnchecked
=
1
,
CheckBitmapIndexChecked
=
2
,
CheckBitmapIndexDisabledUnchecked
=
3
,
CheckBitmapIndexDisabledChecked
=
4
}
CheckBitmapIndex
;
static
void
add_purpose
(
HWND
hwnd
,
LPCSTR
oid
)
{
HWND
lv
=
GetDlgItem
(
hwnd
,
IDC_CERTIFICATE_USAGES
);
...
...
@@ -2518,23 +2579,6 @@ static void select_purposes(HWND hwnd, PurposeSelection selection)
}
}
extern
BOOL
WINAPI
WTHelperGetKnownUsages
(
DWORD
action
,
PCCRYPT_OID_INFO
**
usages
);
static
void
add_known_usage
(
HWND
lv
,
PCCRYPT_OID_INFO
info
)
{
LVITEMW
item
;
item
.
mask
=
LVIF_TEXT
|
LVIF_STATE
|
LVIF_PARAM
;
item
.
state
=
INDEXTOSTATEIMAGEMASK
(
CheckBitmapIndexDisabledChecked
);
item
.
stateMask
=
LVIS_STATEIMAGEMASK
;
item
.
iItem
=
SendMessageW
(
lv
,
LVM_GETITEMCOUNT
,
0
,
0
);
item
.
iSubItem
=
0
;
item
.
lParam
=
(
LPARAM
)
info
;
item
.
pszText
=
(
LPWSTR
)
info
->
pwszName
;
SendMessageW
(
lv
,
LVM_INSERTITEMW
,
0
,
(
LPARAM
)
&
item
);
}
struct
edit_cert_data
{
PCCERT_CONTEXT
cert
;
...
...
@@ -2548,7 +2592,6 @@ static void show_cert_usages(HWND hwnd, struct edit_cert_data *data)
HWND
lv
=
GetDlgItem
(
hwnd
,
IDC_CERTIFICATE_USAGES
);
PCERT_ENHKEY_USAGE
usage
;
DWORD
size
;
PCCRYPT_OID_INFO
*
usages
;
RECT
rc
;
LVCOLUMNW
column
;
PurposeSelection
purposeSelection
;
...
...
@@ -2609,23 +2652,14 @@ static void show_cert_usages(HWND hwnd, struct edit_cert_data *data)
usage
->
rgpszUsageIdentifier
[
i
],
CRYPT_ENHKEY_USAGE_OID_GROUP_ID
);
if
(
info
)
add_known_usage
(
lv
,
info
);
add_known_usage
(
lv
,
info
,
CheckBitmapIndexDisabledChecked
);
else
add_purpose
(
hwnd
,
usage
->
rgpszUsageIdentifier
[
i
]);
}
HeapFree
(
GetProcessHeap
(),
0
,
usage
);
}
else
{
if
(
WTHelperGetKnownUsages
(
1
,
&
usages
))
{
PCCRYPT_OID_INFO
*
ptr
;
for
(
ptr
=
usages
;
*
ptr
;
ptr
++
)
add_known_usage
(
lv
,
*
ptr
);
WTHelperGetKnownUsages
(
2
,
&
usages
);
}
}
add_known_usages_to_list
(
lv
,
CheckBitmapIndexDisabledChecked
);
select_purposes
(
hwnd
,
purposeSelection
);
SendMessageW
(
GetDlgItem
(
hwnd
,
IDC_ENABLE_ALL_PURPOSES
+
purposeSelection
),
BM_CLICK
,
0
,
0
);
...
...
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