#include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
#include <iomanip>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <reason.h>
#include <shlobj.h>
#include <wininet.h>
#include <winreg.h>
#include <ndk/rtlfuncs.h>
#include <reactos/buildno.h>
#include "auto_array_ptr.h"
#include "CConfiguration.h"
#include "CFatalException.h"
#include "CInvalidParameterException.h"
#include "CPipe.h"
#include "CProcess.h"
#include "CPipedProcess.h"
#include "CSimpleException.h"
#include "CTestException.h"
#include "CTestInfo.h"
#include "CTest.h"
#include "CTestList.h"
#include "CJournaledTestList.h"
#include "CVirtualTestList.h"
#include "CWebService.h"
#include "CWineTest.h"
#include <rosautotestmsg.h>
Go to the source code of this file.
◆ _INC_WINDOWS
◆ COM_NO_WINDOWS_H
◆ EXCEPTION
◆ FATAL
◆ SSEXCEPTION
◆ TESTEXCEPTION
◆ WIN32_NO_STATUS
◆ AsciiToUnicode() [1/2]
Converts an ASCII string to a Unicode one.
- Parameters
-
AsciiString | Constant pointer to a char array containing the ASCII string |
- Returns
- The Unicode string as std::wstring
Definition at line 220 of file tools.cpp.
221{
225
227
232
233 return ReturnString;
234}
#define MultiByteToWideChar
_In_ ULONG _In_ ULONG _In_ ULONG Length
__crt_unique_heap_ptr< wchar_t > const wstring(_malloc_crt_t(wchar_t, maxsize))
Referenced by AddPrinterA(), AddPrintProcessorA(), AsciiToUnicode(), DeleteFormA(), DeletePrinterDriverExA(), DeletePrintProcessorA(), DeletePrintProvidorA(), EnumPrinterDriversA(), CWineTest::GetNextTestInfo(), ResetPrinterA(), SetJobA(), SetPrinterA(), and StartDocDlgA().
◆ AsciiToUnicode() [2/2]
Converts an ASCII string to a Unicode one.
- Parameters
-
AsciiString | Pointer to a std::string containing the ASCII string |
- Returns
- The Unicode string as std::wstring
Definition at line 246 of file tools.cpp.
247{
249}
const _CharT * c_str() const
◆ EscapeString() [1/2]
Escapes a string according to RFC 1738. Required for passing parameters to the web service.
- Parameters
-
Input | Constant pointer to a char array, which contains the input buffer to escape. |
- Returns
- The escaped string as std::string.
Definition at line 24 of file tools.cpp.
25{
26 string ReturnedString;
27
28 do
29 {
30 if(
strchr(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~", *
Input))
31 {
32
33 ReturnedString += *
Input;
34 }
35 else
36 {
37
38 ReturnedString += '%';
41 }
42 }
44
45 return ReturnedString;
46}
char * strchr(const char *String, int ch)
Referenced by EscapeString(), CConfiguration::GetConfigurationFromFile(), and CWebService::Submit().
◆ EscapeString() [2/2]
Escapes a string according to RFC 1738. Required for passing parameters to the web service.
- Parameters
-
Input | Pointer to a std::string, which contains the input buffer to escape. |
- Returns
- The escaped string as std::string.
Definition at line 59 of file tools.cpp.
◆ FreeLogs()
Definition at line 85 of file misc.cpp.
86{
88}
BOOL WINAPI DeregisterEventSource(IN HANDLE hEventLog)
◆ GetINIValue()
Gets a value from a specified INI file and returns it converted to ASCII.
- Parameters
-
AppName | Constant pointer to a WCHAR array with the INI section to look in (lpAppName parameter passed to GetPrivateProfileStringW) |
KeyName | Constant pointer to a WCHAR array containing the key to look for in the specified section (lpKeyName parameter passed to GetPrivateProfileStringW) |
FileName | Constant pointer to a WCHAR array containing the path to the INI file |
- Returns
- Returns the data of the value as std::string or an empty string if no data could be retrieved.
Definition at line 187 of file tools.cpp.
188{
191 string ReturnedString;
193
194
196
198 {
199
200 AsciiBuffer =
new char[
Length + 1];
202
203 ReturnedString = AsciiBuffer;
204 delete[] AsciiBuffer;
205 }
206
207 return ReturnedString;
208}
static CHAR AppName[MAX_PATH]
#define WideCharToMultiByte
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Referenced by CConfiguration::GetConfigurationFromFile().
◆ InitLogs()
Definition at line 12 of file misc.cpp.
13{
14 WCHAR szBuf[
MAX_PATH] =
L"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\RosAutotest";
16 DWORD dwCategoryNum = 1;
19
24 {
25 return;
26 }
27
29 return;
30
33 0,
37 {
39 return;
40 }
41
44
47 0,
51 {
53 return;
54 }
55
57 L"CategoryMessageFile",
58 0,
62 {
64 return;
65 }
66
69 0,
73 {
75 return;
76 }
77
79
81}
#define RegCloseKey(hKey)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
HANDLE WINAPI RegisterEventSourceW(IN LPCWSTR lpUNCServerName, IN LPCWSTR lpSourceName)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static HANDLE ULONG_PTR dwData
#define REG_OPTION_NON_VOLATILE
#define GetModuleFileName
#define EVENTLOG_ERROR_TYPE
#define EVENTLOG_INFORMATION_TYPE
#define EVENTLOG_WARNING_TYPE
#define HKEY_LOCAL_MACHINE
◆ IsNumber()
Determines whether a string contains entirely numeric values.
- Parameters
-
Input | Constant pointer to a char array containing the input to check. |
- Returns
- true if the string is entirely numeric, false otherwise.
Definition at line 74 of file tools.cpp.
75{
76 do
77 {
79 return false;
80
82 }
84
85 return true;
86}
Referenced by CWebService::GetSuiteID(), and CWebService::GetTestID().
◆ ShutdownSystem()
Shuts down the system.
- Returns
- true if everything went well, false if there was a problem while trying to shut down the system.
Definition at line 16 of file shutdown.cpp.
17{
20
22 {
24 return false;
25 }
26
27
29 {
30 StringOut(
"LookupPrivilegeValue failed\n");
31 return false;
32 }
33
34
37
39 {
40 StringOut(
"AdjustTokenPrivileges failed\n");
41 return false;
42 }
43
44
46 {
48 return false;
49 }
50
51 return true;
52}
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
#define GetCurrentProcess()
string StringOut(const string &String, bool forcePrint=true)
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET * Privileges
#define TOKEN_ADJUST_PRIVILEGES
#define SE_PRIVILEGE_ENABLED
Referenced by wmain().
◆ StringOut()
Outputs a string through the standard output and the debug output. The string may have LF or CRLF line endings.
- Parameters
-
String | The std::string to output |
Definition at line 96 of file tools.cpp.
97{
99 size_t i,
start = 0, last_newline = 0,
size = 0, curr_pos = 0;
100 string NewString;
101
102
104 {
105
107 {
108 NewString += '\n';
110 }
111 else
112 {
113
115 }
116
117 curr_pos = NewString.
size();
118
119
121 {
123 {
124
126 {
130 }
131 else
132 {
135 start = last_newline;
136 }
137
140 }
141
142 last_newline = curr_pos;
143 }
144 }
145
147
148
149 if(forcePrint == true || NewString[curr_pos - 1] == '\n')
150 {
151
154
158
160 return NewString;
161 }
162
163
166
167
169}
_Self substr(size_type __pos=0, size_type __n=npos) const
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
#define memcpy(s1, s2, n)
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG Configuration
Referenced by CWineTest::GetNextTestInfo(), LdrpAllocateUnicodeString(), CJournaledTestList::LoadJournalFile(), CWineTest::Run(), CWineTest::RunTest(), ShutdownSystem(), wmain(), and CJournaledTestList::WriteInitialJournalFile().
◆ UnicodeToAscii() [1/2]
Converts a Unicode string to an ASCII one.
- Parameters
-
UnicodeString | Pointer to a std::wstring containing the Unicode string |
- Returns
- The ASCII string as std::string
Definition at line 287 of file tools.cpp.
◆ UnicodeToAscii() [2/2]
◆ Configuration
◆ hLog
◆ TestName
Definition at line 13 of file main.cpp.
Referenced by DriverIoControl(), FindTest(), CWineTest::GetNextFile(), KmtFltRunKernelTest(), KmtRunKernelTest(), LdrpSearchPath(), ListTests(), main(), OutputResult(), RunTest(), test_CreateFontIndirect(), test_fullname(), test_match_ex(), and wmain().