#include <apitest.h>
#include <windows.h>
#include <shlwapi.h>
#include <stdio.h>
Go to the source code of this file.
|
static DWORD | getregdw (HKEY hKey, LPCSTR sub, LPCSTR name, DWORD *out, DWORD defval) |
|
static BOOL | makestringfile (LPWSTR path, SIZE_T cchpath, LPCSTR ext, LPCSTR string, const BYTE *map) |
|
static DWORD | runscriptfile (LPCWSTR path, LPCWSTR engine) |
|
static DWORD | runscript (LPCSTR ext, LPCSTR script, const BYTE *map) |
|
static void | test_defaultscriptisjs (void) |
|
static void | test_simplevb (void) |
|
static void | test_defpackagejob (void) |
|
static void | test_objecttag (void) |
|
| START_TEST (wsf) |
|
◆ MYGUID
#define MYGUID "{898AC78E-BFC7-41FF-937D-EDD01E666707}" |
Definition at line 13 of file wsf.c.
◆ getregdw()
Definition at line 15 of file wsf.c.
16{
24}
DWORD WINAPI SHGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Referenced by test_objecttag().
◆ makestringfile()
Definition at line 26 of file wsf.c.
27{
33 {
39 {
41 for (; *
string && succ; ++
string)
42 {
46 {
49 }
51 }
53 return succ;
54 }
55 }
57}
#define INVALID_HANDLE_VALUE
static const WCHAR *const ext[]
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
static DWORD DWORD void LPSTR DWORD cch
Referenced by runscript().
◆ runscript()
◆ runscriptfile()
Definition at line 59 of file wsf.c.
60{
63 LPCWSTR exe = engine ? engine :
L"wscript.exe";
65
71 {
78 }
80}
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
DWORD WINAPI GetLastError(void)
#define ERROR_BUFFER_OVERFLOW
#define ERROR_INTERNAL_ERROR
Referenced by runscript().
◆ START_TEST()
Definition at line 164 of file wsf.c.
165{
170}
static void test_defaultscriptisjs(void)
static void test_objecttag(void)
static void test_defpackagejob(void)
static void test_simplevb(void)
◆ test_defaultscriptisjs()
static void test_defaultscriptisjs |
( |
void |
| ) |
|
|
static |
Definition at line 96 of file wsf.c.
97{
99 "<job>"
100 "<script>"
101 "var x = 42;"
102 "WScript.Quit(x);"
103 "</script>"
104 "</job>";
105
107}
static DWORD runscript(LPCSTR ext, LPCSTR script, const BYTE *map)
Referenced by START_TEST().
◆ test_defpackagejob()
Definition at line 123 of file wsf.c.
124{
126 "<package>"
127 "<job id=\"PickMePlease\">"
128 "<script language=\"VBScript\">"
129 "WScript.Quit 42"
130 "</script>"
131 "</job>"
132 "<job id=\"DontExecuteMe\">"
133 "<script language=\"VBScript\">"
134 "WScript.Quit 33"
135 "</script>"
136 "</job>"
137 "</package>";
138
140}
Referenced by START_TEST().
◆ test_objecttag()
Definition at line 142 of file wsf.c.
143{
145 static const BYTE map[] = {
'#',
'\"',
'$',
'\\', 0, 0 };
147 "<job>"
148 "<object id=#ws1# clsid=#{72C24DD5-D70A-438B-8A42-98424B88AFB8}# />"
149 "<script language=#JScript#>"
150 "var dontcare = ws1.ExpandEnvironmentStrings(#SystemRoot#);"
151 "var p = #HKCU/Software/" MYGUID "#.replace(/$//g,'$$');"
152 "ws2.RegWrite(p, 42, #REG_DWORD#);"
153 "</script>"
154 "<object id=#ws2# progid=#WScript.Shell# />"
155 "</job>";
156
158
160 ok(
dw == 42,
"Value does not match\n");
162}
DWORD WINAPI SHDeleteValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue)
REFIID LPVOID DWORD_PTR dw
#define HKEY_CURRENT_USER
static DWORD getregdw(HKEY hKey, LPCSTR sub, LPCSTR name, DWORD *out, DWORD defval)
Referenced by START_TEST().
◆ test_simplevb()
Definition at line 109 of file wsf.c.
110{
112 "<job>"
113 "<script language=\"VBScript\">"
114 "Dim x\n"
115 "x = 42\n"
116 "WScript.Quit x\n"
117 "</script>"
118 "</job>";
119
121}
Referenced by START_TEST().