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
4e9cbb28
Commit
4e9cbb28
authored
Jan 23, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Jan 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptui: Implement browsing for a filename in the export wizard.
parent
298f7c53
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
0 deletions
+105
-0
cryptui_En.rc
dlls/cryptui/cryptui_En.rc
+6
-0
cryptuires.h
dlls/cryptui/cryptuires.h
+6
-0
main.c
dlls/cryptui/main.c
+93
-0
No files found.
dlls/cryptui/cryptui_En.rc
View file @
4e9cbb28
...
...
@@ -147,6 +147,12 @@ STRINGTABLE DISCARDABLE
IDS_EXPORT_FILE_TITLE "Export Filename"
IDS_EXPORT_FILE_SUBTITLE "Specify the name of the file in which the content will be saved."
IDS_EXPORT_FILE_EXISTS "The specified file already exists. Do you want to replace it?"
IDS_EXPORT_FILTER_CERT "DER-Encoded Binary X.509 (*.cer)"
IDS_EXPORT_FILTER_BASE64_CERT "Base64-Encoded X.509 (*.cer)"
IDS_EXPORT_FILTER_CRL "Certificate Revocation List (*.crl)"
IDS_EXPORT_FILTER_CTL "Certificate Trust List (*.stl)"
IDS_EXPORT_FILTER_CMS "CMS/PKCS #7 Messages (*.p7b)"
IDS_EXPORT_FILTER_PFX "Personal Information Exchange (*.pfx)"
}
IDD_GENERAL DIALOG DISCARDABLE 0, 0, 255, 236
...
...
dlls/cryptui/cryptuires.h
View file @
4e9cbb28
...
...
@@ -146,6 +146,12 @@
#define IDS_EXPORT_FILE_TITLE 1203
#define IDS_EXPORT_FILE_SUBTITLE 1204
#define IDS_EXPORT_FILE_EXISTS 1205
#define IDS_EXPORT_FILTER_CERT 1206
#define IDS_EXPORT_FILTER_BASE64_CERT 1207
#define IDS_EXPORT_FILTER_CRL 1208
#define IDS_EXPORT_FILTER_CTL 1209
#define IDS_EXPORT_FILTER_CMS 1210
#define IDS_EXPORT_FILTER_PFX 1211
#define IDD_GENERAL 100
#define IDD_DETAIL 101
...
...
dlls/cryptui/main.c
View file @
4e9cbb28
...
...
@@ -5718,6 +5718,74 @@ static BOOL export_validate_filename(HWND hwnd, struct ExportWizData *data,
return
ret
;
}
static
const
WCHAR
export_filter_cert
[]
=
{
'*'
,
'.'
,
'c'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
export_filter_crl
[]
=
{
'*'
,
'.'
,
'c'
,
'r'
,
'l'
,
0
};
static
const
WCHAR
export_filter_ctl
[]
=
{
'*'
,
'.'
,
's'
,
't'
,
'l'
,
0
};
static
const
WCHAR
export_filter_cms
[]
=
{
'*'
,
'.'
,
'p'
,
'7'
,
'b'
,
0
};
static
const
WCHAR
export_filter_pfx
[]
=
{
'*'
,
'.'
,
'p'
,
'f'
,
'x'
,
0
};
static
WCHAR
*
make_export_file_filter
(
DWORD
exportFormat
,
DWORD
subjectChoice
)
{
int
baseLen
,
allLen
,
totalLen
=
2
,
baseID
;
LPWSTR
filter
=
NULL
,
baseFilter
,
all
;
LPCWSTR
filterStr
;
switch
(
exportFormat
)
{
case
CRYPTUI_WIZ_EXPORT_FORMAT_BASE64
:
baseID
=
IDS_EXPORT_FILTER_BASE64_CERT
;
filterStr
=
export_filter_cert
;
break
;
case
CRYPTUI_WIZ_EXPORT_FORMAT_PFX
:
baseID
=
IDS_EXPORT_FILTER_PFX
;
filterStr
=
export_filter_pfx
;
break
;
case
CRYPTUI_WIZ_EXPORT_FORMAT_PKCS7
:
baseID
=
IDS_EXPORT_FILTER_CMS
;
filterStr
=
export_filter_cms
;
break
;
default:
switch
(
subjectChoice
)
{
case
CRYPTUI_WIZ_EXPORT_CRL_CONTEXT
:
baseID
=
IDS_EXPORT_FILTER_CRL
;
filterStr
=
export_filter_crl
;
break
;
case
CRYPTUI_WIZ_EXPORT_CTL_CONTEXT
:
baseID
=
IDS_EXPORT_FILTER_CTL
;
filterStr
=
export_filter_ctl
;
break
;
default:
baseID
=
IDS_EXPORT_FILTER_CERT
;
filterStr
=
export_filter_cert
;
break
;
}
}
baseLen
=
LoadStringW
(
hInstance
,
baseID
,
(
LPWSTR
)
&
baseFilter
,
0
);
totalLen
+=
baseLen
+
strlenW
(
filterStr
)
+
2
;
allLen
=
LoadStringW
(
hInstance
,
IDS_IMPORT_FILTER_ALL
,
(
LPWSTR
)
&
all
,
0
);
totalLen
+=
allLen
+
strlenW
(
filter_all
)
+
2
;
filter
=
HeapAlloc
(
GetProcessHeap
(),
0
,
totalLen
*
sizeof
(
WCHAR
));
if
(
filter
)
{
LPWSTR
ptr
;
ptr
=
filter
;
memcpy
(
ptr
,
baseFilter
,
baseLen
*
sizeof
(
WCHAR
));
ptr
+=
baseLen
;
*
ptr
++
=
0
;
strcpyW
(
ptr
,
filterStr
);
ptr
+=
strlenW
(
filterStr
)
+
1
;
memcpy
(
ptr
,
all
,
allLen
*
sizeof
(
WCHAR
));
ptr
+=
allLen
;
*
ptr
++
=
0
;
strcpyW
(
ptr
,
filter_all
);
ptr
+=
strlenW
(
filter_all
)
+
1
;
*
ptr
++
=
0
;
}
return
filter
;
}
static
LRESULT
CALLBACK
export_file_dlg_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
...
...
@@ -5808,6 +5876,31 @@ static LRESULT CALLBACK export_file_dlg_proc(HWND hwnd, UINT msg, WPARAM wp,
}
break
;
}
case
WM_COMMAND
:
switch
(
wp
)
{
case
IDC_EXPORT_BROWSE_FILE
:
{
OPENFILENAMEW
ofn
;
WCHAR
fileBuf
[
MAX_PATH
];
data
=
(
struct
ExportWizData
*
)
GetWindowLongPtrW
(
hwnd
,
DWLP_USER
);
memset
(
&
ofn
,
0
,
sizeof
(
ofn
));
ofn
.
lStructSize
=
sizeof
(
ofn
);
ofn
.
hwndOwner
=
hwnd
;
ofn
.
lpstrFilter
=
make_export_file_filter
(
data
->
exportFormat
,
data
->
pExportInfo
->
dwSubjectChoice
);
ofn
.
lpstrFile
=
fileBuf
;
ofn
.
nMaxFile
=
sizeof
(
fileBuf
)
/
sizeof
(
fileBuf
[
0
]);
fileBuf
[
0
]
=
0
;
if
(
GetSaveFileNameW
(
&
ofn
))
SendMessageW
(
GetDlgItem
(
hwnd
,
IDC_EXPORT_FILENAME
),
WM_SETTEXT
,
0
,
(
LPARAM
)
ofn
.
lpstrFile
);
HeapFree
(
GetProcessHeap
(),
0
,
(
LPWSTR
)
ofn
.
lpstrFilter
);
break
;
}
}
break
;
}
return
ret
;
}
...
...
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