From 76a73b429519543e959f411f661915b9114fd241 Mon Sep 17 00:00:00 2001 From: Jared Smudde Date: Tue, 5 Jun 2018 10:17:00 -0500 Subject: [PATCH] [MSHTA] Implement MSHTA.exe (#577) CORE-12813 Implement mshta.exe. It links directly to the function RunHTMLApplication in mshtml and passes the file name and other optional arguments along. While the function is unimplemented in mshtml, it's a start. [MSHTML] Add ADD_IMPORTLIB to CMakeLists so mshta can link to mshtml. [BOOTDATA] Add the association information for mshta.exe to the registry. --- base/applications/CMakeLists.txt | 1 + base/applications/mshta/CMakeLists.txt | 6 ++++++ base/applications/mshta/main.c | 18 ++++++++++++++++++ base/applications/mshta/mshta.ico | Bin 0 -> 5430 bytes base/applications/mshta/mshta.rc | 7 +++++++ boot/bootdata/hivecls.inf | 6 ++++++ dll/win32/mshtml/CMakeLists.txt | 2 +- 7 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 base/applications/mshta/CMakeLists.txt create mode 100644 base/applications/mshta/main.c create mode 100644 base/applications/mshta/mshta.ico create mode 100644 base/applications/mshta/mshta.rc diff --git a/base/applications/CMakeLists.txt b/base/applications/CMakeLists.txt index 2af017dff50b..4c7677abdcf8 100644 --- a/base/applications/CMakeLists.txt +++ b/base/applications/CMakeLists.txt @@ -23,6 +23,7 @@ add_subdirectory(mplay32) add_subdirectory(msconfig) add_subdirectory(msconfig_new) add_subdirectory(mscutils) +add_subdirectory(mshta) add_subdirectory(mspaint) add_subdirectory(mstsc) add_subdirectory(network) diff --git a/base/applications/mshta/CMakeLists.txt b/base/applications/mshta/CMakeLists.txt new file mode 100644 index 000000000000..e34b8228f282 --- /dev/null +++ b/base/applications/mshta/CMakeLists.txt @@ -0,0 +1,6 @@ + +add_executable(mshta main.c mshta.rc) +target_link_libraries(mshta) +set_module_type(mshta win32gui) +add_importlibs(mshta msvcrt mshtml kernel32 ntdll) +add_cd_file(TARGET mshta DESTINATION reactos/system32 FOR all) diff --git a/base/applications/mshta/main.c b/base/applications/mshta/main.c new file mode 100644 index 000000000000..b7a47d047d82 --- /dev/null +++ b/base/applications/mshta/main.c @@ -0,0 +1,18 @@ +/* + * PROJECT: ReactOS HTML Application Host + * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+) + * PURPOSE: Forwards HTA application information to mshtml + * COPYRIGHT: Copyright 2017-2018 Jared Smudde(computerwhiz02@hotmail.com) + */ + +#include +#include +#include +#include + +extern DWORD WINAPI RunHTMLApplication(HINSTANCE hinst, HINSTANCE hPrevInst, LPSTR szCmdLine, int nCmdShow); + +int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow) +{ + return RunHTMLApplication(hInst, hPrevInst, cmdline, cmdshow); +} diff --git a/base/applications/mshta/mshta.ico b/base/applications/mshta/mshta.ico new file mode 100644 index 0000000000000000000000000000000000000000..c0ab82c23cc388e17febe5563b06c8f705ec8add GIT binary patch literal 5430 zcmd^@Sx{4F6vr>NW3|hSGtTs-FSHMxKJ}r~hfX_A`|L~K99yZiwzi$oPVIwIWVEQU zT2WLs7j*0xB!VkT62uU30TKv-kU#_iWH*pzCy|8Z-|t+wlwN7Q(VCZjGrxRy`Of*@ zZ@W3?a$FX-jLXjESe?yXTE%g1a~!vd)pY*-iyUWU$M3LftO@rCgRV;~%UC<+fqRLu z;yJK<-hURW7nfJrNjBqM#s`cwjE|oKA2OfBdyF?3uP{~?78YJTa^wh(9zB{7NJ}P@ zshIX#46dlCXf_ZCAQTE^1kxf+CcT>Uso$h+x7(iz+t3iMmmh?D_t%i;Z9rw-=aBE( z0EKKD+LYCg`6MmUByB3sqJOvH3KR#nK~~JymVJlLy0aK_*^o#i(002K`ih^>R=yQ?j%|kK&}T52OfcNn zKzF4Sbtiu2{gak>{3DSFJRXl^S}vW2x@;H5M*A^4JIfOa24Ga|he=U@&htCaTE2}R zbFBcpOfr6W6NFp{xEJ)Tj4>w8Z+cSPVX&Pcn)lWsO<|dg;LZiF}SMNPs%+CR7iS=om{C>Y=s`q|_v0)3$+8U%>1|T>B zghqMBhm4q+nc<&-YOmXg(P0}#yEJ_NNlUCx>zCe3QmHS=$AeZS+%7vp!%RP92f_}X zY5yR4yV}vyu7zG%37u96pVy6^MmcU)$oRb?)_?TqQCja_U40dr&g{kHL>L~o3!{A< zK*Y&#AvHdT2iv-rKf!Sol zY{-eJzz7l^3oJSfjBPEjj|?H~_oA!ecPLBqdH+l4Pfkwq`-1j{RP5GXRQ<9UeJ!={ zd+cxybmRW*CJc6J;kRhf-=W2rV*o~#9M$`_z-_bgzDY~me_EroF4M(5Y(>q1t+-XO zAA|Z^2)J#SVEy&8@$SD{i<>9+prJSq-jN3jzDY~0pGu|pbwTU!X)xbYq4roV6ni#- z_GT5U8&BXASbutYntxBw*gS7YORP`t33{$fV4Rv+QlFkH z6Hs5p{TKd2Ggb5Y0LA)z`~_B8t4q;(sU&^Uv?DEEKZe&A>no4%L?#gQSA;=1z(W5o z=B`I35cF3j@Wx{OlV7bt`KFK3hV0U@74$jaWzwfyfYx0m%i{H4R#qlw=d*MzQxu;% zRY`sSzZW~ly-+Ye2vjq&{zJ&07~a3I*62G0`&_{%{}R7b&^HSDj_?{|b=B^TGg9Jk z)|RVlRBco>H(@bS<7l!cyJ$3qP?+-cFdr{Uje`aIU?>Q$kY{;4s4JEh#|rjgmP`12 zV+(o8{p%Mb#i4>d#dboRKhENPLP{Jd*i-Hj3u&3BR5{|GO zkYe4)T)fMU9RrqsjpGD+ijQKk2|kCSXZedLJC36FjuJPDcJlET&8<9tBQE5wZx-w+ z_MD6F;z-035TDb%_&juv=A3M)&~a)i^|$y)d_KwYJ|1RE_sC{>Z0>)Sj;C0RQMu)P yNl;s{KE0<8uFaMNwH4b7`%Y>tvd^LOG|8D8y=VJvVde!-B5S@4)r$a|!9M}n%# literal 0 HcmV?d00001 diff --git a/base/applications/mshta/mshta.rc b/base/applications/mshta/mshta.rc new file mode 100644 index 000000000000..6865b5de3e76 --- /dev/null +++ b/base/applications/mshta/mshta.rc @@ -0,0 +1,7 @@ +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS HTML Application Host" +#define REACTOS_STR_INTERNAL_NAME "mshta" +#define REACTOS_STR_ORIGINAL_FILENAME "mshta.exe" + +#include + +1 ICON "mshta.ico" diff --git a/boot/bootdata/hivecls.inf b/boot/bootdata/hivecls.inf index 1568b545f522..61d6f4f318a9 100644 --- a/boot/bootdata/hivecls.inf +++ b/boot/bootdata/hivecls.inf @@ -216,6 +216,12 @@ HKCR,"chm.file","",0x00000000,%CHMFILE% HKCR,"chm.file\DefaultIcon","",0x00020000,"%SystemRoot%\hh.exe,0" HKCR,"chm.file\shell\open\command","",0x00020000,"%SystemRoot%\hh.exe %1" +; HTA Files +HKCR,".hta","",0x00000000,"htafile" +HKCR,"htafile","",0x00000000,"HTML Application" +HKCR,"htafile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\mshta.exe,-1" +HKCR,"htafile\shell\open\command","",0x00020000,"%SystemRoot%\system32\mshta.exe ""%1"" %*" + ; set MIME type for .html and .htm because Tiny webserver needs it HKCR,".htm","",0x00000000,"htmlfile" HKCR,".htm","Content Type",0x00000000,"text/html" diff --git a/dll/win32/mshtml/CMakeLists.txt b/dll/win32/mshtml/CMakeLists.txt index 5db472483dca..1b93bfa575f1 100644 --- a/dll/win32/mshtml/CMakeLists.txt +++ b/dll/win32/mshtml/CMakeLists.txt @@ -8,7 +8,7 @@ add_definitions( include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) add_idl_headers(mshtml_nsiface_header nsiface.idl) -spec2def(mshtml.dll mshtml.spec) +spec2def(mshtml.dll mshtml.spec ADD_IMPORTLIB) list(APPEND SOURCE conpoint.c