* ReactOS MSVCRT.DLL Compatibility Library
*/
-#include "precomp.h"
-#include <msvcrt/internal/tls.h>
-#include <msvcrt/stdlib.h>
-#include <msvcrt/string.h>
-
+#include <precomp.h>
+#include <internal/tls.h>
+#include <stdlib.h>
+#include <string.h>
+
#define NDEBUG
-#include <msvcrt/msvcrtdbg.h>
+#include <internal/debug.h>
unsigned int _osver = 0;
unsigned int _winminor = 0;
unsigned int _winmajor = 0;
unsigned int _winver = 0;
-
+
char *_acmdln = NULL; /* pointer to ascii command line */
wchar_t *_wcmdln = NULL; /* pointer to wide character command line */
wchar_t **_wenviron = NULL; /* pointer to environment block */
char **__initenv = NULL; /* pointer to initial environment block */
wchar_t **__winitenv = NULL; /* pointer to initial environment block */
-#undef _pgmptr
+#undef _pgmptr
char *_pgmptr = NULL; /* pointer to program name */
+#undef _wpgmptr
+wchar_t *_wpgmptr = NULL; /* pointer to program name */
int __app_type = 0; //_UNKNOWN_APP; /* application type */
int __mb_cur_max = 1;
/* Add terminating NULL entry. */
*envptr = NULL;
}
-
+
FreeEnvironmentStringsA(environment_strings);
return _environ ? 0 : -1;
}
/* Add terminating NULL entry. */
*envptr = NULL;
}
-
+
FreeEnvironmentStringsW(environment_strings);
return _wenviron ? 0 : -1;
}
free(*newenvptr);
free(newenv);
return original_environment;
- }
- }
+ }
+ }
+ *newenvptr = NULL;
return newenv;
}
if (!found)
{
free(name);
- return -1;
+ return 0;
}
/* Remove the option from wide character environment. */
* the environments are in sync and the option is at the
* same position. */
free(_environ[index]);
- for (; _environ[index] != NULL; index++)
- _environ[index] = _environ[index + 1];
+ memmove(&_environ[index], &_environ[index+1], (count - index) * sizeof(char*));
_environ = realloc(_environ, count * sizeof(char*));
result = SetEnvironmentVariableW(name, NULL) ? 0 : -1;
return &_acmdln;
}
+/*
+ * @implemented
+ */
+wchar_t **__p__wcmdln(void)
+{
+ return &_wcmdln;
+}
+
/*
* @implemented
*/
return &_pgmptr;
}
+/*
+ * @implemented
+ */
+wchar_t **__p__wpgmptr(void)
+{
+ return &_wpgmptr;
+}
+
/*
* @implemented
*/