Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
28efdcb5
Commit
28efdcb5
authored
Jul 27, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wscript.exe: Added engine lookup implementation.
parent
35b8c927
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
1 deletion
+59
-1
Makefile.in
programs/wscript/Makefile.in
+1
-1
main.c
programs/wscript/main.c
+58
-0
No files found.
programs/wscript/Makefile.in
View file @
28efdcb5
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
wscript.exe
APPMODE
=
-mwindows
-municode
IMPORTS
=
IMPORTS
=
ole32 advapi32
EXTRADEFS
=
-DWINE_NO_UNICODE_MACROS
C_SRCS
=
\
...
...
programs/wscript/main.c
View file @
28efdcb5
...
...
@@ -20,13 +20,71 @@
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <ole2.h>
#include <wine/debug.h>
#include <wine/unicode.h>
WINE_DEFAULT_DEBUG_CHANNEL
(
wscript
);
static
BOOL
get_engine_clsid
(
const
WCHAR
*
ext
,
CLSID
*
clsid
)
{
WCHAR
fileid
[
64
],
progid
[
64
];
DWORD
res
;
LONG
size
;
HKEY
hkey
;
HRESULT
hres
;
static
const
WCHAR
script_engineW
[]
=
{
'\\'
,
'S'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
'E'
,
'n'
,
'g'
,
'i'
,
'n'
,
'e'
,
0
};
res
=
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
ext
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
size
=
sizeof
(
fileid
)
/
sizeof
(
WCHAR
);
res
=
RegQueryValueW
(
hkey
,
NULL
,
fileid
,
&
size
);
RegCloseKey
(
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
WINE_TRACE
(
"fileid is %s
\n
"
,
wine_dbgstr_w
(
fileid
));
strcatW
(
fileid
,
script_engineW
);
res
=
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
fileid
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
size
=
sizeof
(
progid
)
/
sizeof
(
WCHAR
);
res
=
RegQueryValueW
(
hkey
,
NULL
,
progid
,
&
size
);
RegCloseKey
(
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
WINE_TRACE
(
"ProgID is %s
\n
"
,
wine_dbgstr_w
(
progid
));
hres
=
CLSIDFromProgID
(
progid
,
clsid
);
return
SUCCEEDED
(
hres
);
}
int
WINAPI
wWinMain
(
HINSTANCE
hInst
,
HINSTANCE
hPrevInst
,
LPWSTR
cmdline
,
int
cmdshow
)
{
const
WCHAR
*
ext
;
CLSID
clsid
;
WINE_FIXME
(
"(%p %p %s %x)
\n
"
,
hInst
,
hPrevInst
,
wine_dbgstr_w
(
cmdline
),
cmdshow
);
if
(
!*
cmdline
)
return
1
;
ext
=
strchrW
(
cmdline
,
'.'
);
if
(
!
ext
)
ext
=
cmdline
;
if
(
!
get_engine_clsid
(
ext
,
&
clsid
))
{
WINE_FIXME
(
"Could not fine engine for %s
\n
"
,
wine_dbgstr_w
(
ext
));
return
1
;
}
return
0
;
}
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