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
e3b4ebeb
Commit
e3b4ebeb
authored
Dec 01, 2007
by
Vitaly Lipatov
Committed by
Alexandre Julliard
Dec 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledlg: Use wide strings, fix buffers size.
parent
0f6e826f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
23 deletions
+22
-23
Makefile.in
dlls/oledlg/Makefile.in
+1
-1
insobjdlg.c
dlls/oledlg/insobjdlg.c
+21
-22
No files found.
dlls/oledlg/Makefile.in
View file @
e3b4ebeb
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
oledlg.dll
MODULE
=
oledlg.dll
IMPORTLIB
=
liboledlg.
$(IMPLIBEXT)
IMPORTLIB
=
liboledlg.
$(IMPLIBEXT)
IMPORTS
=
ole32 comdlg32 user32 advapi32 kernel32
ntdll
IMPORTS
=
ole32 comdlg32 user32 advapi32 kernel32
C_SRCS
=
\
C_SRCS
=
\
insobjdlg.c
\
insobjdlg.c
\
...
...
dlls/oledlg/insobjdlg.c
View file @
e3b4ebeb
...
@@ -332,38 +332,39 @@ static void UIINSERTOBJECTDLG_SelectCreateFromFile(InsertObjectDlgInfo* pdlgInfo
...
@@ -332,38 +332,39 @@ static void UIINSERTOBJECTDLG_SelectCreateFromFile(InsertObjectDlgInfo* pdlgInfo
*/
*/
static
BOOL
UIINSERTOBJECTDLG_PopulateObjectTypes
(
InsertObjectDlgInfo
*
pdlgInfo
)
static
BOOL
UIINSERTOBJECTDLG_PopulateObjectTypes
(
InsertObjectDlgInfo
*
pdlgInfo
)
{
{
static
const
WCHAR
szClsid
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
0
};
static
const
WCHAR
szInsertable
[]
=
{
'I'
,
'n'
,
's'
,
'e'
,
'r'
,
't'
,
'a'
,
'b'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
szNotInsertable
[]
=
{
'N'
,
'o'
,
't'
,
'I'
,
'n'
,
's'
,
'e'
,
'r'
,
't'
,
'a'
,
'b'
,
'l'
,
'e'
,
0
};
DWORD
i
;
DWORD
i
;
LONG
len
;
LONG
len
;
HKEY
hkclsids
;
HKEY
hkclsids
;
HKEY
hkey
;
HKEY
hkey
;
CLSID
clsid
;
CLSID
clsid
;
HRESULT
ret
;
HRESULT
ret
;
CHAR
szclsid
[
128
];
WCHAR
keydesc
[
MAX_PATH
];
CHAR
keydesc
[
MAX_PATH
];
WCHAR
keyname
[
MAX_PATH
];
CHAR
keyname
[
MAX_PATH
];
WCHAR
szclsid
[
128
];
WCHAR
wszclsid
[
128
];
DWORD
index
=
0
;
DWORD
index
=
0
;
UIINSERTOBJECTDLG_FreeObjectTypes
(
pdlgInfo
);
UIINSERTOBJECTDLG_FreeObjectTypes
(
pdlgInfo
);
RegOpenKeyEx
A
(
HKEY_CLASSES_ROOT
,
"CLSID"
,
0
,
KEY_READ
,
&
hkclsids
);
RegOpenKeyEx
W
(
HKEY_CLASSES_ROOT
,
szClsid
,
0
,
KEY_READ
,
&
hkclsids
);
while
(
ERROR_SUCCESS
==
(
ret
=
RegEnumKey
A
(
hkclsids
,
index
,
szclsid
,
MAX_PATH
)))
while
(
ERROR_SUCCESS
==
(
ret
=
RegEnumKey
W
(
hkclsids
,
index
,
szclsid
,
sizeof
(
szclsid
)
/
sizeof
(
szclsid
[
0
])
)))
{
{
index
++
;
index
++
;
RegOpenKeyEx
A
(
hkclsids
,
szclsid
,
0
,
KEY_READ
,
&
hkey
);
RegOpenKeyEx
W
(
hkclsids
,
szclsid
,
0
,
KEY_READ
,
&
hkey
);
len
=
MAX_PATH
;
len
=
sizeof
(
keyname
)
;
if
(
ERROR_SUCCESS
!=
RegQueryValue
A
(
hkey
,
"Insertable"
,
keyname
,
&
len
))
if
(
ERROR_SUCCESS
!=
RegQueryValue
W
(
hkey
,
szInsertable
,
keyname
,
&
len
))
continue
;
continue
;
len
=
MAX_PATH
;
len
=
sizeof
(
keyname
)
;
if
(
ERROR_SUCCESS
==
RegQueryValue
A
(
hkey
,
"NotInsertable"
,
keyname
,
&
len
))
if
(
ERROR_SUCCESS
==
RegQueryValue
W
(
hkey
,
szNotInsertable
,
keyname
,
&
len
))
continue
;
continue
;
RtlMultiByteToUnicodeN
(
wszclsid
,
MAX_PATH
,
NULL
,
szclsid
,
MAX_PATH
);
CLSIDFromString
(
szclsid
,
&
clsid
);
CLSIDFromString
(
wszclsid
,
&
clsid
);
for
(
i
=
0
;
i
<
pdlgInfo
->
lpOleUIInsertObject
->
cClsidExclude
;
i
++
)
for
(
i
=
0
;
i
<
pdlgInfo
->
lpOleUIInsertObject
->
cClsidExclude
;
i
++
)
if
(
IsEqualGUID
(
&
pdlgInfo
->
lpOleUIInsertObject
->
lpClsidExclude
[
i
],
&
clsid
))
if
(
IsEqualGUID
(
&
pdlgInfo
->
lpOleUIInsertObject
->
lpClsidExclude
[
i
],
&
clsid
))
...
@@ -372,14 +373,14 @@ static BOOL UIINSERTOBJECTDLG_PopulateObjectTypes(InsertObjectDlgInfo* pdlgInfo)
...
@@ -372,14 +373,14 @@ static BOOL UIINSERTOBJECTDLG_PopulateObjectTypes(InsertObjectDlgInfo* pdlgInfo)
if
(
i
<
pdlgInfo
->
lpOleUIInsertObject
->
cClsidExclude
)
if
(
i
<
pdlgInfo
->
lpOleUIInsertObject
->
cClsidExclude
)
continue
;
continue
;
len
=
MAX_PATH
;
len
=
sizeof
(
keydesc
)
;
if
(
ERROR_SUCCESS
==
RegQueryValue
A
(
hkey
,
NULL
,
keydesc
,
&
len
))
if
(
ERROR_SUCCESS
==
RegQueryValue
W
(
hkey
,
NULL
,
keydesc
,
&
len
))
{
{
CLSID
*
lpclsid
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
CLSID
));
CLSID
*
lpclsid
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
CLSID
));
memcpy
(
lpclsid
,
&
clsid
,
sizeof
(
CLSID
));
memcpy
(
lpclsid
,
&
clsid
,
sizeof
(
CLSID
));
len
=
SendMessage
A
(
pdlgInfo
->
hwndObjTypeLB
,
LB_ADDSTRING
,
0
,
(
LPARAM
)
keydesc
);
len
=
SendMessage
W
(
pdlgInfo
->
hwndObjTypeLB
,
LB_ADDSTRING
,
0
,
(
LPARAM
)
keydesc
);
SendMessage
A
(
pdlgInfo
->
hwndObjTypeLB
,
LB_SETITEMDATA
,
(
WPARAM
)
len
,
(
LPARAM
)
lpclsid
);
SendMessage
W
(
pdlgInfo
->
hwndObjTypeLB
,
LB_SETITEMDATA
,
(
WPARAM
)
len
,
(
LPARAM
)
lpclsid
);
}
}
}
}
...
@@ -471,17 +472,15 @@ static BOOL UIINSERTOBJECTDLG_OnOpen(InsertObjectDlgInfo* pdlgInfo)
...
@@ -471,17 +472,15 @@ static BOOL UIINSERTOBJECTDLG_OnOpen(InsertObjectDlgInfo* pdlgInfo)
}
}
else
if
(
BST_CHECKED
==
SendMessageA
(
pdlgInfo
->
hwndCreateFromFileCB
,
BM_GETCHECK
,
0
,
0
))
else
if
(
BST_CHECKED
==
SendMessageA
(
pdlgInfo
->
hwndCreateFromFileCB
,
BM_GETCHECK
,
0
,
0
))
{
{
char
fname
[
MAX_PATH
];
if
(
pdlgInfo
->
lpOleUIInsertObject
->
lpszFile
)
if
(
pdlgInfo
->
lpOleUIInsertObject
->
lpszFile
)
{
{
HRESULT
hres
;
HRESULT
hres
;
WCHAR
wcsFile
[
MAX_PATH
];
WCHAR
wcsFile
[
MAX_PATH
];
SendMessageA
(
pdlgInfo
->
hwndFileTB
,
WM_GETTEXT
,
(
WPARAM
)
MAX_PATH
,
(
LPARAM
)
fname
);
if
(
SendMessageW
(
pdlgInfo
->
hwndFileTB
,
WM_GETTEXT
,
MAX_PATH
,
(
LPARAM
)
wcsFile
))
lstrcpynA
(
pdlgInfo
->
lpOleUIInsertObject
->
lpszFile
,
fname
,
pdlgInfo
->
lpOleUIInsertObject
->
cchFile
);
WideCharToMultiByte
(
CP_ACP
,
0
,
wcsFile
,
-
1
,
pdlgInfo
->
lpOleUIInsertObject
->
lpszFile
,
pdlgInfo
->
lpOleUIInsertObject
->
cchFile
,
NULL
,
NULL
);
RtlMultiByteToUnicodeN
(
wcsFile
,
MAX_PATH
,
NULL
,
fname
,
MAX_PATH
);
if
(
ERROR_SUCCESS
==
(
hres
=
GetClassFile
(
wcsFile
,
&
pdlgInfo
->
lpOleUIInsertObject
->
clsid
)))
if
(
ERROR_SUCCESS
==
(
hres
=
GetClassFile
(
wcsFile
,
&
pdlgInfo
->
lpOleUIInsertObject
->
clsid
)))
{
{
if
(
pdlgInfo
->
lpOleUIInsertObject
->
dwFlags
&
IOF_CREATEFILEOBJECT
)
if
(
pdlgInfo
->
lpOleUIInsertObject
->
dwFlags
&
IOF_CREATEFILEOBJECT
)
...
...
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