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
6c8fac7d
Commit
6c8fac7d
authored
Oct 01, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jsproxy: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
449d2694
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
14 deletions
+7
-14
main.c
dlls/jsproxy/main.c
+7
-14
No files found.
dlls/jsproxy/main.c
View file @
6c8fac7d
...
...
@@ -46,9 +46,6 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
};
static
CRITICAL_SECTION
cs_jsproxy
=
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
const
WCHAR
global_funcsW
[]
=
{
'g'
,
'l'
,
'o'
,
'b'
,
'a'
,
'l'
,
'_'
,
'f'
,
'u'
,
'n'
,
'c'
,
's'
,
0
};
static
const
WCHAR
dns_resolveW
[]
=
{
'd'
,
'n'
,
's'
,
'_'
,
'r'
,
'e'
,
's'
,
'o'
,
'l'
,
'v'
,
'e'
,
0
};
/******************************************************************
* DllMain (jsproxy.@)
*/
...
...
@@ -271,7 +268,7 @@ static HRESULT WINAPI dispex_GetNameSpaceParent(
static
HRESULT
WINAPI
dispex_GetDispID
(
IDispatchEx
*
iface
,
BSTR
name
,
DWORD
flags
,
DISPID
*
id
)
{
if
(
!
lstrcmpW
(
name
,
dns_resolveW
))
if
(
!
lstrcmpW
(
name
,
L"dns_resolve"
))
{
*
id
=
DISPID_GLOBAL_DNSRESOLVE
;
return
S_OK
;
...
...
@@ -306,7 +303,6 @@ static void printf_addr( const WCHAR *fmt, WCHAR *buf, SIZE_T size, struct socka
static
HRESULT
dns_resolve
(
const
WCHAR
*
hostname
,
VARIANT
*
result
)
{
static
const
WCHAR
fmtW
[]
=
{
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
'.'
,
'%'
,
'u'
,
0
};
WCHAR
addr
[
16
];
struct
addrinfo
*
ai
,
*
elem
;
char
*
hostnameA
;
...
...
@@ -329,7 +325,7 @@ static HRESULT dns_resolve( const WCHAR *hostname, VARIANT *result )
freeaddrinfo
(
ai
);
return
S_FALSE
;
}
printf_addr
(
fmtW
,
addr
,
ARRAY_SIZE
(
addr
),
(
struct
sockaddr_in
*
)
elem
->
ai_addr
);
printf_addr
(
L"%u.%u.%u.%u"
,
addr
,
ARRAY_SIZE
(
addr
),
(
struct
sockaddr_in
*
)
elem
->
ai_addr
);
freeaddrinfo
(
ai
);
V_VT
(
result
)
=
VT_BSTR
;
V_BSTR
(
result
)
=
SysAllocString
(
addr
);
...
...
@@ -408,7 +404,7 @@ static HRESULT WINAPI site_GetItemInfo(
IActiveScriptSite
*
iface
,
LPCOLESTR
name
,
DWORD
mask
,
IUnknown
**
item
,
ITypeInfo
**
type_info
)
{
if
(
!
lstrcmpW
(
name
,
global_funcsW
)
&&
mask
==
SCRIPTINFO_IUNKNOWN
)
if
(
!
lstrcmpW
(
name
,
L"global_funcs"
)
&&
mask
==
SCRIPTINFO_IUNKNOWN
)
{
*
item
=
(
IUnknown
*
)
&
global_dispex
;
return
S_OK
;
...
...
@@ -471,7 +467,6 @@ static IActiveScriptSite script_site = { &site_vtbl };
static
BSTR
include_pac_utils
(
const
WCHAR
*
script
)
{
static
const
WCHAR
pacjsW
[]
=
{
'p'
,
'a'
,
'c'
,
'.'
,
'j'
,
's'
,
0
};
HMODULE
hmod
=
GetModuleHandleA
(
"jsproxy.dll"
);
HRSRC
rsrc
;
DWORD
size
;
...
...
@@ -479,7 +474,7 @@ static BSTR include_pac_utils( const WCHAR *script )
BSTR
ret
;
int
len
;
if
(
!
(
rsrc
=
FindResourceW
(
hmod
,
pacjsW
,
(
LPCWSTR
)
40
)))
return
NULL
;
if
(
!
(
rsrc
=
FindResourceW
(
hmod
,
L"pac.js"
,
(
LPCWSTR
)
40
)))
return
NULL
;
size
=
SizeofResource
(
hmod
,
rsrc
);
data
=
LoadResource
(
hmod
,
rsrc
);
...
...
@@ -502,8 +497,6 @@ static BSTR include_pac_utils( const WCHAR *script )
static
BOOL
run_script
(
const
WCHAR
*
script
,
const
WCHAR
*
url
,
const
WCHAR
*
hostname
,
char
**
result_str
,
DWORD
*
result_len
)
{
static
const
WCHAR
jscriptW
[]
=
{
'J'
,
'S'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
0
};
static
const
WCHAR
findproxyW
[]
=
{
'F'
,
'i'
,
'n'
,
'd'
,
'P'
,
'r'
,
'o'
,
'x'
,
'y'
,
'F'
,
'o'
,
'r'
,
'U'
,
'R'
,
'L'
,
0
};
IActiveScriptParse
*
parser
=
NULL
;
IActiveScript
*
engine
=
NULL
;
IDispatch
*
dispatch
=
NULL
;
...
...
@@ -516,7 +509,7 @@ static BOOL run_script( const WCHAR *script, const WCHAR *url, const WCHAR *host
HRESULT
hr
,
init
;
init
=
CoInitialize
(
NULL
);
hr
=
CLSIDFromProgID
(
jscriptW
,
&
clsid
);
hr
=
CLSIDFromProgID
(
L"JScript"
,
&
clsid
);
if
(
hr
!=
S_OK
)
goto
done
;
hr
=
CoCreateInstance
(
&
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
...
...
@@ -532,7 +525,7 @@ static BOOL run_script( const WCHAR *script, const WCHAR *url, const WCHAR *host
hr
=
IActiveScript_SetScriptSite
(
engine
,
&
script_site
);
if
(
hr
!=
S_OK
)
goto
done
;
hr
=
IActiveScript_AddNamedItem
(
engine
,
global_funcsW
,
SCRIPTITEM_GLOBALMEMBERS
);
hr
=
IActiveScript_AddNamedItem
(
engine
,
L"global_funcs"
,
SCRIPTITEM_GLOBALMEMBERS
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
!
(
full_script
=
include_pac_utils
(
script
)))
goto
done
;
...
...
@@ -546,7 +539,7 @@ static BOOL run_script( const WCHAR *script, const WCHAR *url, const WCHAR *host
hr
=
IActiveScript_GetScriptDispatch
(
engine
,
NULL
,
&
dispatch
);
if
(
hr
!=
S_OK
)
goto
done
;
if
(
!
(
func
=
SysAllocString
(
findproxyW
)))
goto
done
;
if
(
!
(
func
=
SysAllocString
(
L"FindProxyForURL"
)))
goto
done
;
hr
=
IDispatch_GetIDsOfNames
(
dispatch
,
&
IID_NULL
,
&
func
,
1
,
LOCALE_SYSTEM_DEFAULT
,
&
dispid
);
if
(
hr
!=
S_OK
)
goto
done
;
...
...
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