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
5436fc90
Commit
5436fc90
authored
Jan 22, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Store source cookie and starting line in vbscode_t.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7a76856e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
10 deletions
+19
-10
compile.c
dlls/vbscript/compile.c
+10
-5
vbscript.c
dlls/vbscript/vbscript.c
+3
-2
vbscript.h
dlls/vbscript/vbscript.h
+6
-3
No files found.
dlls/vbscript/compile.c
View file @
5436fc90
...
...
@@ -1856,7 +1856,7 @@ void release_vbscode(vbscode_t *code)
heap_free
(
code
);
}
static
vbscode_t
*
alloc_vbscode
(
compile_ctx_t
*
ctx
,
const
WCHAR
*
source
)
static
vbscode_t
*
alloc_vbscode
(
compile_ctx_t
*
ctx
,
const
WCHAR
*
source
,
DWORD_PTR
cookie
,
unsigned
start_line
)
{
vbscode_t
*
ret
;
size_t
len
;
...
...
@@ -1878,6 +1878,9 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source)
memcpy
(
ret
->
source
,
source
,
len
*
sizeof
(
WCHAR
));
ret
->
source
[
len
]
=
0
;
ret
->
cookie
=
cookie
;
ret
->
start_line
=
start_line
;
ret
->
instrs
=
heap_alloc
(
32
*
sizeof
(
instr_t
));
if
(
!
ret
->
instrs
)
{
release_vbscode
(
ret
);
...
...
@@ -1904,7 +1907,8 @@ static void release_compiler(compile_ctx_t *ctx)
release_vbscode
(
ctx
->
code
);
}
HRESULT
compile_script
(
script_ctx_t
*
script
,
const
WCHAR
*
src
,
const
WCHAR
*
delimiter
,
DWORD
flags
,
vbscode_t
**
ret
)
HRESULT
compile_script
(
script_ctx_t
*
script
,
const
WCHAR
*
src
,
const
WCHAR
*
delimiter
,
DWORD_PTR
cookie
,
unsigned
start_line
,
DWORD
flags
,
vbscode_t
**
ret
)
{
function_decl_t
*
func_decl
;
class_decl_t
*
class_decl
;
...
...
@@ -1913,7 +1917,7 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli
vbscode_t
*
code
;
HRESULT
hres
;
code
=
ctx
.
code
=
alloc_vbscode
(
&
ctx
,
src
);
code
=
ctx
.
code
=
alloc_vbscode
(
&
ctx
,
src
,
cookie
,
start_line
);
if
(
!
ctx
.
code
)
return
E_OUTOFMEMORY
;
...
...
@@ -1978,13 +1982,14 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *deli
return
S_OK
;
}
HRESULT
compile_procedure
(
script_ctx_t
*
script
,
const
WCHAR
*
src
,
const
WCHAR
*
delimiter
,
DWORD
flags
,
class_desc_t
**
ret
)
HRESULT
compile_procedure
(
script_ctx_t
*
script
,
const
WCHAR
*
src
,
const
WCHAR
*
delimiter
,
DWORD_PTR
cookie
,
unsigned
start_line
,
DWORD
flags
,
class_desc_t
**
ret
)
{
class_desc_t
*
desc
;
vbscode_t
*
code
;
HRESULT
hres
;
hres
=
compile_script
(
script
,
src
,
delimiter
,
flags
&
~
SCRIPTTEXT_ISPERSISTENT
,
&
code
);
hres
=
compile_script
(
script
,
src
,
delimiter
,
cookie
,
start_line
,
flags
&
~
SCRIPTTEXT_ISPERSISTENT
,
&
code
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/vbscript/vbscript.c
View file @
5436fc90
...
...
@@ -875,7 +875,7 @@ static HRESULT WINAPI VBScriptParse_ParseScriptText(IActiveScriptParse *iface,
}
}
hres
=
compile_script
(
This
->
ctx
,
pstrCode
,
pstrDelimiter
,
dwFlags
,
&
code
);
hres
=
compile_script
(
This
->
ctx
,
pstrCode
,
pstrDelimiter
,
dw
SourceContextCookie
,
ulStartingLine
,
dw
Flags
,
&
code
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -939,7 +939,8 @@ static HRESULT WINAPI VBScriptParseProcedure_ParseProcedureText(IActiveScriptPar
if
(
This
->
thread_id
!=
GetCurrentThreadId
()
||
This
->
state
==
SCRIPTSTATE_CLOSED
)
return
E_UNEXPECTED
;
hres
=
compile_procedure
(
This
->
ctx
,
pstrCode
,
pstrDelimiter
,
dwFlags
,
&
desc
);
hres
=
compile_procedure
(
This
->
ctx
,
pstrCode
,
pstrDelimiter
,
dwSourceContextCookie
,
ulStartingLineNumber
,
dwFlags
,
&
desc
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/vbscript/vbscript.h
View file @
5436fc90
...
...
@@ -335,9 +335,12 @@ struct _function_t {
struct
_vbscode_t
{
instr_t
*
instrs
;
WCHAR
*
source
;
unsigned
ref
;
WCHAR
*
source
;
DWORD_PTR
cookie
;
unsigned
start_line
;
BOOL
option_explicit
;
BOOL
pending_exec
;
...
...
@@ -363,8 +366,8 @@ static inline void grab_vbscode(vbscode_t *code)
}
void
release_vbscode
(
vbscode_t
*
)
DECLSPEC_HIDDEN
;
HRESULT
compile_script
(
script_ctx_t
*
,
const
WCHAR
*
,
const
WCHAR
*
,
DWORD
,
vbscode_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
compile_procedure
(
script_ctx_t
*
,
const
WCHAR
*
,
const
WCHAR
*
,
DWORD
,
class_desc_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
compile_script
(
script_ctx_t
*
,
const
WCHAR
*
,
const
WCHAR
*
,
DWORD
_PTR
,
unsigned
,
DWORD
,
vbscode_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
compile_procedure
(
script_ctx_t
*
,
const
WCHAR
*
,
const
WCHAR
*
,
DWORD
_PTR
,
unsigned
,
DWORD
,
class_desc_t
**
)
DECLSPEC_HIDDEN
;
HRESULT
exec_script
(
script_ctx_t
*
,
BOOL
,
function_t
*
,
vbdisp_t
*
,
DISPPARAMS
*
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
void
release_dynamic_var
(
dynamic_var_t
*
)
DECLSPEC_HIDDEN
;
IDispatch
*
lookup_named_item
(
script_ctx_t
*
,
const
WCHAR
*
,
unsigned
)
DECLSPEC_HIDDEN
;
...
...
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