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
9a20d35c
Commit
9a20d35c
authored
Feb 22, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Declare strdupAtoW in hhctrl.h and use it instead of duplicated *ANSIToUnicode.
parent
6e72b261
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
26 deletions
+17
-26
chm.c
dlls/hhctrl.ocx/chm.c
+1
-13
help.c
dlls/hhctrl.ocx/help.c
+1
-13
hhctrl.h
dlls/hhctrl.ocx/hhctrl.h
+15
-0
No files found.
dlls/hhctrl.ocx/chm.c
View file @
9a20d35c
...
@@ -20,18 +20,6 @@
...
@@ -20,18 +20,6 @@
#include "hhctrl.h"
#include "hhctrl.h"
static
LPWSTR
CHM_ANSIToUnicode
(
LPCSTR
ansi
)
{
LPWSTR
unicode
;
int
count
;
count
=
MultiByteToWideChar
(
CP_ACP
,
0
,
ansi
,
-
1
,
NULL
,
0
);
unicode
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
ansi
,
-
1
,
unicode
,
count
);
return
unicode
;
}
/* Reads a string from the #STRINGS section in the CHM file */
/* Reads a string from the #STRINGS section in the CHM file */
static
LPWSTR
CHM_ReadString
(
CHMInfo
*
pChmInfo
,
DWORD
dwOffset
)
static
LPWSTR
CHM_ReadString
(
CHMInfo
*
pChmInfo
,
DWORD
dwOffset
)
{
{
...
@@ -70,7 +58,7 @@ static LPWSTR CHM_ReadString(CHMInfo *pChmInfo, DWORD dwOffset)
...
@@ -70,7 +58,7 @@ static LPWSTR CHM_ReadString(CHMInfo *pChmInfo, DWORD dwOffset)
{
{
if
(
!
szString
[
iPos
])
if
(
!
szString
[
iPos
])
{
{
stringW
=
CHM_ANSIToUnicode
(
szString
);
stringW
=
strdupAtoW
(
szString
);
HeapFree
(
GetProcessHeap
(),
0
,
szString
);
HeapFree
(
GetProcessHeap
(),
0
,
szString
);
return
stringW
;
return
stringW
;
}
}
...
...
dlls/hhctrl.ocx/help.c
View file @
9a20d35c
...
@@ -57,18 +57,6 @@ typedef struct tagHHInfo
...
@@ -57,18 +57,6 @@ typedef struct tagHHInfo
extern
HINSTANCE
hhctrl_hinstance
;
extern
HINSTANCE
hhctrl_hinstance
;
static
LPWSTR
HH_ANSIToUnicode
(
LPCSTR
ansi
)
{
LPWSTR
unicode
;
int
count
;
count
=
MultiByteToWideChar
(
CP_ACP
,
0
,
ansi
,
-
1
,
NULL
,
0
);
unicode
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
ansi
,
-
1
,
unicode
,
count
);
return
unicode
;
}
/* Loads a string from the resource file */
/* Loads a string from the resource file */
static
LPWSTR
HH_LoadString
(
DWORD
dwID
)
static
LPWSTR
HH_LoadString
(
DWORD
dwID
)
{
{
...
@@ -861,7 +849,7 @@ int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
...
@@ -861,7 +849,7 @@ int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
if
(
FAILED
(
OleInitialize
(
NULL
)))
if
(
FAILED
(
OleInitialize
(
NULL
)))
return
-
1
;
return
-
1
;
pHHInfo
=
HH_OpenHH
(
hInstance
,
HH_ANSIToUnicode
(
szCmdLine
));
pHHInfo
=
HH_OpenHH
(
hInstance
,
strdupAtoW
(
szCmdLine
));
if
(
!
pHHInfo
||
!
HH_OpenCHM
(
pHHInfo
)
||
!
HH_CreateViewer
(
pHHInfo
))
if
(
!
pHHInfo
||
!
HH_OpenCHM
(
pHHInfo
)
||
!
HH_CreateViewer
(
pHHInfo
))
{
{
OleUninitialize
();
OleUninitialize
();
...
...
dlls/hhctrl.ocx/hhctrl.h
View file @
9a20d35c
...
@@ -70,4 +70,19 @@ BOOL CHM_OpenCHM(CHMInfo *pCHMInfo, LPCWSTR szFile);
...
@@ -70,4 +70,19 @@ BOOL CHM_OpenCHM(CHMInfo *pCHMInfo, LPCWSTR szFile);
BOOL
CHM_LoadWinTypeFromCHM
(
CHMInfo
*
pCHMInfo
,
HH_WINTYPEW
*
pHHWinType
);
BOOL
CHM_LoadWinTypeFromCHM
(
CHMInfo
*
pCHMInfo
,
HH_WINTYPEW
*
pHHWinType
);
void
CHM_CloseCHM
(
CHMInfo
*
pCHMInfo
);
void
CHM_CloseCHM
(
CHMInfo
*
pCHMInfo
);
static
inline
LPWSTR
strdupAtoW
(
LPCSTR
str
)
{
LPWSTR
ret
;
DWORD
len
;
if
(
!
str
)
return
NULL
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
return
ret
;
}
#endif
#endif
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