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
53fc5b85
Commit
53fc5b85
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's friendly name and description in edit properties dialog.
parent
7153a6fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
35 deletions
+44
-35
main.c
dlls/cryptui/main.c
+44
-35
No files found.
dlls/cryptui/main.c
View file @
53fc5b85
...
...
@@ -1554,6 +1554,49 @@ static void create_cert_details_list(HWND hwnd, struct detail_data *data)
set_fields_selection
(
hwnd
,
data
,
0
);
}
static
WCHAR
*
get_cert_property_as_string
(
PCCERT_CONTEXT
cert
,
DWORD
prop
)
{
WCHAR
*
name
=
NULL
;
DWORD
cb
;
if
(
CertGetCertificateContextProperty
(
cert
,
prop
,
NULL
,
&
cb
))
{
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cb
);
if
(
name
)
{
if
(
!
CertGetCertificateContextProperty
(
cert
,
prop
,
(
LPBYTE
)
name
,
&
cb
))
{
HeapFree
(
GetProcessHeap
(),
0
,
name
);
name
=
NULL
;
}
}
}
return
name
;
}
static
void
set_general_cert_properties
(
HWND
hwnd
,
struct
detail_data
*
data
)
{
PCCERT_CONTEXT
cert
=
data
->
pCertViewInfo
->
pCertContext
;
WCHAR
*
str
;
if
((
str
=
get_cert_property_as_string
(
cert
,
CERT_FRIENDLY_NAME_PROP_ID
)))
{
SendMessageW
(
GetDlgItem
(
hwnd
,
IDC_FRIENDLY_NAME
),
WM_SETTEXT
,
0
,
(
LPARAM
)
str
);
HeapFree
(
GetProcessHeap
(),
0
,
str
);
}
if
((
str
=
get_cert_property_as_string
(
cert
,
CERT_DESCRIPTION_PROP_ID
)))
{
SendMessageW
(
GetDlgItem
(
hwnd
,
IDC_DESCRIPTION
),
WM_SETTEXT
,
0
,
(
LPARAM
)
str
);
HeapFree
(
GetProcessHeap
(),
0
,
str
);
}
FIXME
(
"show cert usages
\n
"
);
EnableWindow
(
GetDlgItem
(
hwnd
,
IDC_ADD_PURPOSE
),
FALSE
);
SendMessageW
(
GetDlgItem
(
hwnd
,
IDC_ENABLE_ALL_PURPOSES
),
BM_CLICK
,
0
,
0
);
}
#define MAX_FRIENDLY_NAME 40
#define MAX_DESCRIPTION 255
...
...
@@ -1577,23 +1620,10 @@ static LRESULT CALLBACK cert_properties_general_dlg_proc(HWND hwnd, UINT msg,
MAX_FRIENDLY_NAME
,
0
);
SendMessageW
(
description
,
EM_SETLIMITTEXT
,
MAX_DESCRIPTION
,
0
);
ShowScrollBar
(
description
,
SB_VERT
,
FALSE
);
FIXME
(
"set general properties
\n
"
);
set_general_cert_properties
(
hwnd
,
data
);
SetWindowLongPtrW
(
hwnd
,
DWLP_USER
,
(
LPARAM
)
data
);
break
;
}
case
WM_COMMAND
:
switch
(
HIWORD
(
wp
))
{
case
BN_CLICKED
:
switch
(
LOWORD
(
wp
))
{
case
IDC_ADD_PURPOSE
:
FIXME
(
"show add purpose dialog
\n
"
);
break
;
}
break
;
}
break
;
}
return
0
;
}
...
...
@@ -1827,27 +1857,6 @@ static struct hierarchy_data *get_hierarchy_data_from_tree_item(HWND tree,
return
data
;
}
static
WCHAR
*
get_cert_property_as_string
(
PCCERT_CONTEXT
cert
,
DWORD
prop
)
{
WCHAR
*
name
=
NULL
;
DWORD
cb
;
if
(
CertGetCertificateContextProperty
(
cert
,
prop
,
NULL
,
&
cb
))
{
name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cb
);
if
(
name
)
{
if
(
!
CertGetCertificateContextProperty
(
cert
,
prop
,
(
LPBYTE
)
name
,
&
cb
))
{
HeapFree
(
GetProcessHeap
(),
0
,
name
);
name
=
NULL
;
}
}
}
return
name
;
}
static
WCHAR
*
get_cert_display_name
(
PCCERT_CONTEXT
cert
)
{
WCHAR
*
name
=
get_cert_property_as_string
(
cert
,
CERT_FRIENDLY_NAME_PROP_ID
);
...
...
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