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
3a87b4c1
Commit
3a87b4c1
authored
Jan 24, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added GetObject implementation.
parent
8347c67c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
18 deletions
+79
-18
global.c
dlls/vbscript/global.c
+79
-18
No files found.
dlls/vbscript/global.c
View file @
3a87b4c1
...
...
@@ -30,6 +30,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
vbscript
);
#define VB_E_CANNOT_CREATE_OBJ 0x800a01ad
#define VB_E_MK_PARSE_ERROR 0x800a01b0
/* Defined as extern in urlmon.idl, but not exported by uuid.lib */
const
GUID
GUID_CUSTOM_CONFIRMOBJECTSAFETY
=
...
...
@@ -216,10 +217,29 @@ static HRESULT to_string(VARIANT *v, BSTR *ret)
return
S_OK
;
}
static
HRESULT
set_object_site
(
script_ctx_t
*
ctx
,
IUnknown
*
obj
)
{
IObjectWithSite
*
obj_site
;
IUnknown
*
ax_site
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
obj
,
&
IID_IObjectWithSite
,
(
void
**
)
&
obj_site
);
if
(
FAILED
(
hres
))
return
S_OK
;
ax_site
=
create_ax_site
(
ctx
);
if
(
ax_site
)
hres
=
IObjectWithSite_SetSite
(
obj_site
,
ax_site
);
else
hres
=
E_OUTOFMEMORY
;
IUnknown_Release
(
ax_site
);
IObjectWithSite_Release
(
obj_site
);
return
hres
;
}
static
IUnknown
*
create_object
(
script_ctx_t
*
ctx
,
const
WCHAR
*
progid
)
{
IInternetHostSecurityManager
*
secmgr
=
NULL
;
IObjectWithSite
*
obj_site
;
struct
CONFIRMSAFETY
cs
;
IClassFactoryEx
*
cfex
;
IClassFactory
*
cf
;
...
...
@@ -279,20 +299,10 @@ static IUnknown *create_object(script_ctx_t *ctx, const WCHAR *progid)
}
}
hres
=
IUnknown_QueryInterface
(
obj
,
&
IID_IObjectWithSite
,
(
void
**
)
&
obj_site
);
if
(
SUCCEEDED
(
hres
))
{
IUnknown
*
ax_site
;
ax_site
=
create_ax_site
(
ctx
);
if
(
ax_site
)
{
hres
=
IObjectWithSite_SetSite
(
obj_site
,
ax_site
);
IUnknown_Release
(
ax_site
);
}
IObjectWithSite_Release
(
obj_site
);
if
(
!
ax_site
||
FAILED
(
hres
))
{
IUnknown_Release
(
obj
);
return
NULL
;
}
hres
=
set_object_site
(
ctx
,
obj
);
if
(
FAILED
(
hres
))
{
IUnknown_Release
(
obj
);
return
NULL
;
}
return
obj
;
...
...
@@ -1275,10 +1285,61 @@ static HRESULT Global_CreateObject(vbdisp_t *This, VARIANT *arg, unsigned args_c
return
S_OK
;
}
static
HRESULT
Global_GetObject
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
static
HRESULT
Global_GetObject
(
vbdisp_t
*
This
,
VARIANT
*
arg
s
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
IBindCtx
*
bind_ctx
;
IUnknown
*
obj_unk
;
IDispatch
*
disp
;
ULONG
eaten
=
0
;
IMoniker
*
mon
;
HRESULT
hres
;
TRACE
(
"%s %s
\n
"
,
args_cnt
?
debugstr_variant
(
args
)
:
""
,
args_cnt
>
1
?
debugstr_variant
(
args
+
1
)
:
""
);
if
(
args_cnt
!=
1
||
V_VT
(
args
)
!=
VT_BSTR
)
{
FIXME
(
"unsupported args
\n
"
);
return
E_NOTIMPL
;
}
if
(
This
->
desc
->
ctx
->
safeopt
&
(
INTERFACE_USES_SECURITY_MANAGER
|
INTERFACESAFE_FOR_UNTRUSTED_DATA
))
{
WARN
(
"blocked in current safety mode
\n
"
);
return
VB_E_CANNOT_CREATE_OBJ
;
}
hres
=
CreateBindCtx
(
0
,
&
bind_ctx
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
MkParseDisplayName
(
bind_ctx
,
V_BSTR
(
args
),
&
eaten
,
&
mon
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
IMoniker_BindToObject
(
mon
,
bind_ctx
,
NULL
,
&
IID_IUnknown
,
(
void
**
)
&
obj_unk
);
IMoniker_Release
(
mon
);
}
else
{
hres
=
MK_E_SYNTAX
;
}
IBindCtx_Release
(
bind_ctx
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
set_object_site
(
This
->
desc
->
ctx
,
obj_unk
);
if
(
FAILED
(
hres
))
{
IUnknown_Release
(
obj_unk
);
return
hres
;
}
hres
=
IUnknown_QueryInterface
(
obj_unk
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
if
(
SUCCEEDED
(
hres
))
{
if
(
res
)
{
V_VT
(
res
)
=
VT_DISPATCH
;
V_DISPATCH
(
res
)
=
disp
;
}
else
{
IDispatch_Release
(
disp
);
}
}
else
{
FIXME
(
"object does not support IDispatch
\n
"
);
}
return
hres
;
}
static
HRESULT
Global_DateAdd
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
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