Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a468c039
Commit
a468c039
authored
Dec 22, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Dec 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptui: Perform import when finishing the CryptUIWizImport wizard.
parent
72980e1b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
38 deletions
+76
-38
cryptui_En.rc
dlls/cryptui/cryptui_En.rc
+2
-0
cryptuires.h
dlls/cryptui/cryptuires.h
+2
-0
main.c
dlls/cryptui/main.c
+72
-38
No files found.
dlls/cryptui/cryptui_En.rc
View file @
a468c039
...
...
@@ -91,6 +91,8 @@ STRINGTABLE DISCARDABLE
IDS_IMPORT_CONTENT_CMS "CMS/PKCS #7 Message"
IDS_IMPORT_CONTENT_PFX "Personal Information Exchange"
IDS_IMPORT_CONTENT_STORE "Certificate Store"
IDS_IMPORT_SUCCEEDED "The import was successful."
IDS_IMPORT_FAILED "The import failed."
IDS_PURPOSE_SERVER_AUTH "Ensures the identify of a remote computer"
IDS_PURPOSE_CLIENT_AUTH "Proves your identity to a remote computer"
IDS_PURPOSE_CODE_SIGNING "Ensures software came from software publisher\nProtects software from alteration after publication"
...
...
dlls/cryptui/cryptuires.h
View file @
a468c039
...
...
@@ -88,6 +88,8 @@
#define IDS_IMPORT_CONTENT_CMS 1068
#define IDS_IMPORT_CONTENT_PFX 1069
#define IDS_IMPORT_CONTENT_STORE 1070
#define IDS_IMPORT_SUCCEEDED 1071
#define IDS_IMPORT_FAILED 1072
#define IDS_PURPOSE_SERVER_AUTH 1100
#define IDS_PURPOSE_CLIENT_AUTH 1101
...
...
dlls/cryptui/main.c
View file @
a468c039
...
...
@@ -3791,6 +3791,7 @@ struct ImportWizData
HCERTSTORE
hDestCertStore
;
BOOL
freeDest
;
BOOL
autoDest
;
BOOL
success
;
};
static
BOOL
import_validate_filename
(
HWND
hwnd
,
struct
ImportWizData
*
data
,
...
...
@@ -4122,6 +4123,47 @@ static void show_import_details(HWND lv, struct ImportWizData *data)
}
}
static
BOOL
do_import
(
DWORD
dwFlags
,
HWND
hwndParent
,
LPCWSTR
pwszWizardTitle
,
PCCRYPTUI_WIZ_IMPORT_SRC_INFO
pImportSrc
,
HCERTSTORE
hDestCertStore
)
{
BOOL
ret
;
switch
(
pImportSrc
->
dwSubjectChoice
)
{
case
CRYPTUI_WIZ_IMPORT_SUBJECT_FILE
:
ret
=
import_file
(
dwFlags
,
hwndParent
,
pwszWizardTitle
,
pImportSrc
->
u
.
pwszFileName
,
hDestCertStore
);
break
;
case
CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT
:
if
((
ret
=
check_context_type
(
dwFlags
,
CERT_QUERY_CONTENT_CERT
)))
ret
=
import_cert
(
pImportSrc
->
u
.
pCertContext
,
hDestCertStore
);
else
import_warn_type_mismatch
(
dwFlags
,
hwndParent
,
pwszWizardTitle
);
break
;
case
CRYPTUI_WIZ_IMPORT_SUBJECT_CRL_CONTEXT
:
if
((
ret
=
check_context_type
(
dwFlags
,
CERT_QUERY_CONTENT_CRL
)))
ret
=
import_crl
(
pImportSrc
->
u
.
pCRLContext
,
hDestCertStore
);
else
import_warn_type_mismatch
(
dwFlags
,
hwndParent
,
pwszWizardTitle
);
break
;
case
CRYPTUI_WIZ_IMPORT_SUBJECT_CTL_CONTEXT
:
if
((
ret
=
check_context_type
(
dwFlags
,
CERT_QUERY_CONTENT_CTL
)))
ret
=
import_ctl
(
pImportSrc
->
u
.
pCTLContext
,
hDestCertStore
);
else
import_warn_type_mismatch
(
dwFlags
,
hwndParent
,
pwszWizardTitle
);
break
;
case
CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_STORE
:
ret
=
import_store
(
dwFlags
,
hwndParent
,
pwszWizardTitle
,
pImportSrc
->
u
.
hCertStore
,
hDestCertStore
);
break
;
default:
WARN
(
"unknown source type: %u
\n
"
,
pImportSrc
->
dwSubjectChoice
);
SetLastError
(
E_INVALIDARG
);
ret
=
FALSE
;
}
return
ret
;
}
static
LRESULT
CALLBACK
import_finish_dlg_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
...
...
@@ -4165,6 +4207,32 @@ static LRESULT CALLBACK import_finish_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
ret
=
TRUE
;
break
;
}
case
PSN_WIZFINISH
:
{
data
=
(
struct
ImportWizData
*
)
GetWindowLongPtrW
(
hwnd
,
DWLP_USER
);
if
((
data
->
success
=
do_import
(
data
->
dwFlags
,
hwnd
,
data
->
pwszWizardTitle
,
&
data
->
importSrc
,
data
->
hDestCertStore
)))
{
WCHAR
title
[
MAX_STRING_LEN
],
message
[
MAX_STRING_LEN
];
LPCWSTR
pTitle
;
if
(
data
->
pwszWizardTitle
)
pTitle
=
data
->
pwszWizardTitle
;
else
{
LoadStringW
(
hInstance
,
IDS_IMPORT_WIZARD
,
title
,
sizeof
(
title
)
/
sizeof
(
title
[
0
]));
pTitle
=
title
;
}
LoadStringW
(
hInstance
,
IDS_IMPORT_SUCCEEDED
,
message
,
sizeof
(
message
)
/
sizeof
(
message
[
0
]));
MessageBoxW
(
hwnd
,
message
,
pTitle
,
MB_OK
);
}
else
import_warning
(
data
->
dwFlags
,
hwnd
,
data
->
pwszWizardTitle
,
IDS_IMPORT_SUCCEEDED
);
break
;
}
}
break
;
}
...
...
@@ -4181,8 +4249,6 @@ static BOOL show_import_ui(DWORD dwFlags, HWND hwndParent,
struct
ImportWizData
data
;
int
nPages
=
0
;
FIXME
(
"
\n
"
);
data
.
dwFlags
=
dwFlags
;
data
.
pwszWizardTitle
=
pwszWizardTitle
;
if
(
pImportSrc
)
...
...
@@ -4194,6 +4260,7 @@ static BOOL show_import_ui(DWORD dwFlags, HWND hwndParent,
data
.
hDestCertStore
=
hDestCertStore
;
data
.
freeDest
=
FALSE
;
data
.
autoDest
=
TRUE
;
data
.
success
=
TRUE
;
memset
(
&
pages
,
0
,
sizeof
(
pages
));
...
...
@@ -4272,7 +4339,7 @@ static BOOL show_import_ui(DWORD dwFlags, HWND hwndParent,
if
(
data
.
freeSource
&&
data
.
importSrc
.
dwSubjectChoice
==
CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_STORE
)
CertCloseStore
(
data
.
importSrc
.
u
.
hCertStore
,
0
);
return
FALSE
;
return
data
.
success
;
}
BOOL
WINAPI
CryptUIWizImport
(
DWORD
dwFlags
,
HWND
hwndParent
,
LPCWSTR
pwszWizardTitle
,
...
...
@@ -4294,41 +4361,8 @@ BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardT
ret
=
show_import_ui
(
dwFlags
,
hwndParent
,
pwszWizardTitle
,
pImportSrc
,
hDestCertStore
);
else
if
(
pImportSrc
)
{
switch
(
pImportSrc
->
dwSubjectChoice
)
{
case
CRYPTUI_WIZ_IMPORT_SUBJECT_FILE
:
ret
=
import_file
(
dwFlags
,
hwndParent
,
pwszWizardTitle
,
pImportSrc
->
u
.
pwszFileName
,
hDestCertStore
);
break
;
case
CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT
:
if
((
ret
=
check_context_type
(
dwFlags
,
CERT_QUERY_CONTENT_CERT
)))
ret
=
import_cert
(
pImportSrc
->
u
.
pCertContext
,
hDestCertStore
);
else
import_warn_type_mismatch
(
dwFlags
,
hwndParent
,
pwszWizardTitle
);
break
;
case
CRYPTUI_WIZ_IMPORT_SUBJECT_CRL_CONTEXT
:
if
((
ret
=
check_context_type
(
dwFlags
,
CERT_QUERY_CONTENT_CRL
)))
ret
=
import_crl
(
pImportSrc
->
u
.
pCRLContext
,
hDestCertStore
);
else
import_warn_type_mismatch
(
dwFlags
,
hwndParent
,
pwszWizardTitle
);
break
;
case
CRYPTUI_WIZ_IMPORT_SUBJECT_CTL_CONTEXT
:
if
((
ret
=
check_context_type
(
dwFlags
,
CERT_QUERY_CONTENT_CTL
)))
ret
=
import_ctl
(
pImportSrc
->
u
.
pCTLContext
,
hDestCertStore
);
else
import_warn_type_mismatch
(
dwFlags
,
hwndParent
,
pwszWizardTitle
);
break
;
case
CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_STORE
:
ret
=
import_store
(
dwFlags
,
hwndParent
,
pwszWizardTitle
,
pImportSrc
->
u
.
hCertStore
,
hDestCertStore
);
break
;
default:
WARN
(
"unknown source type: %u
\n
"
,
pImportSrc
->
dwSubjectChoice
);
SetLastError
(
E_INVALIDARG
);
ret
=
FALSE
;
}
}
ret
=
do_import
(
dwFlags
,
hwndParent
,
pwszWizardTitle
,
pImportSrc
,
hDestCertStore
);
else
{
/* Can't have no UI without specifying source */
...
...
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