35 'f',
'o',
'=',
't',
'i',
't',
'i',0,
36 'f',
'o',
'o',
'o',
'=',
't',
'u',
't',
'u',0,
37 's',
'r',
'=',
'a',
'n',
'=',
'o',
'u',
'o',0,
38 'g',
'=',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
39 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
40 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
41 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
42 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
43 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
44 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
45 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
46 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
47 'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',
'a',0,
48 '=',
'o',
'O',
'H',
'=',
'I',
'I',
'I',0,
75 {
"g", 256,
STATUS_SUCCESS,
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
76"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},
96 name.MaximumLength =
name.Length + 2;
106 "[%d]: Wrong status for '%s', expecting %x got %x\n",
108 if (nts ==
test->status)
switch (nts)
116 "Wrong result for %s/%d\n",
test->var,
test->len);
117 ok(bv[
test->len] ==
'@',
"Writing too far away in the buffer for %s/%d\n",
test->var,
test->len);
121 "Wrong returned length %d (too small buffer) for %s\n",
value.Length,
test->var );
129 WCHAR bvar[256], bval1[256], bval2[256];
145 nts = pRtlSetEnvironmentVariable(
env, &uvar,
val ? &uval :
NULL);
146 ok(nts ==
ret || (alt && nts == alt),
"Setting var %s=%s (%x/%x)\n",
var,
val, nts,
ret);
152 nts = pRtlQueryEnvironmentVariable_U(*
env, &uvar, &uval);
156 ok(
lstrcmpW(bval1, bval2) == 0,
"Cannot get value written to environment\n");
161 "Couldn't find variable, but didn't delete it. val = %s\n",
val);
164 ok(0,
"Wrong ret %u for %s\n", nts,
var);
189 for (
i = 0;
i < 128;
i++)
195 for (
i = 0;
i < 128;
i++)
207 static const struct test
213 {
"hello%foo%world",
"hellototoworld"},
214 {
"hello%=oOH%world",
"helloIIIworld"},
215 {
"hello%foo",
"hello%foo"},
216 {
"hello%bar%world",
"hello%bar%world"},
246 nts = pRtlExpandEnvironmentStrings_U(
small_env, &us_src, &us_dst, &ul);
249 "Wrong returned length for %s: %u\n",
test->src, ul );
255 nts = pRtlExpandEnvironmentStrings_U(
small_env, &us_src, &us_dst, &ul);
258 "Wrong returned length for %s: %u\n",
test->src, ul);
260 "Wrong returned length for %s: %u\n",
test->src, ul);
261 ok(
lstrcmpW(
dst, rst) == 0,
"Wrong result for %s: expecting %s\n",
268 nts = pRtlExpandEnvironmentStrings_U(
small_env, &us_src, &us_dst, &ul);
271 "Wrong returned length for %s (with buffer too small): %u\n",
test->src, ul);
272 ok(
dst[8] ==
'-',
"Writing too far in buffer (got %c/%d)\n",
dst[8],
dst[8]);
282 win_skip(
"Not running on NT, skipping tests\n");
289 pRtlQueryEnvironmentVariable_U = (
void*)
GetProcAddress(
mod,
"RtlQueryEnvironmentVariable_U");
290 pRtlSetCurrentEnvironment = (
void*)
GetProcAddress(
mod,
"RtlSetCurrentEnvironment");
291 pRtlSetEnvironmentVariable = (
void*)
GetProcAddress(
mod,
"RtlSetEnvironmentVariable");
292 pRtlExpandEnvironmentStrings_U = (
void*)
GetProcAddress(
mod,
"RtlExpandEnvironmentStrings_U");
294 if (pRtlQueryEnvironmentVariable_U)
296 if (pRtlSetEnvironmentVariable)
298 if (pRtlExpandEnvironmentStrings_U)
std::map< E_MODULE, HMODULE > mod
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strchr(const char *String, int ch)
static LPCWSTR LPCWSTR LPCWSTR env
#define GetProcAddress(x, y)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
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
static struct test_info tests[]
#define sprintf(buf, format,...)
static DWORD LPDWORD LPCSTR DWORD srclen
static DWORD LPDWORD reslen
static void testExpand(void)
static void testSet(void)
static DWORD LPDWORD LPCSTR src
static void testSetHelper(LPWSTR *env, const char *var, const char *val, NTSTATUS ret, NTSTATUS alt)
static void testQuery(void)
#define STATUS_VARIABLE_NOT_FOUND
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_INVALID_PARAMETER