4bool __wrap_save_preferences(
bool commit,
5 const wchar_t *deploy_key,
6 const wchar_t *output_dir,
7 const wchar_t *output_file,
10 const wchar_t *specified_path,
11 enum OUTPUT_FORMAT format) {
12 check_expected(commit);
13 check_expected(format);
14 check_expected(max_depth);
15 check_expected_ptr(deploy_key);
16 check_expected_ptr(hk);
17 check_expected_ptr(output_dir);
18 check_expected_ptr(output_file);
19 check_expected_ptr(specified_path);
20 return mock_type(
bool);
23bool __wrap_export_single_value(HKEY top_key,
const wchar_t *reg_path,
enum OUTPUT_FORMAT format) {
24 check_expected(format);
25 check_expected_ptr(reg_path);
26 check_expected_ptr(top_key);
27 return mock_type(
bool);
30wchar_t *__wrap_get_git_branch(
const wchar_t *git_dir_arg,
31 size_t git_dir_arg_len,
32 const wchar_t *work_tree_arg,
33 size_t work_tree_arg_len) {
34 return mock_ptr_type(
wchar_t *);
37LSTATUS __wrap_RegCloseKey(HKEY hKey) {
38 return mock_type(LSTATUS);
41int __wrap_GetTimeFormat(LCID Locale,
43 const SYSTEMTIME *lpTime,
47 return mock_type(
int);
50int __wrap_GetDateFormat(LCID Locale,
52 const SYSTEMTIME *lpDate,
56 return mock_type(
int);
59wchar_t *__wrap__wfullpath(
wchar_t *absPath,
const wchar_t *relPath,
size_t maxLength) {
60 wchar_t *absPathRet = mock_ptr_type(
wchar_t *);
61 wmemset(absPath, L
'\0', maxLength);
63 wmemcpy(absPath, absPathRet, wcslen(absPathRet));
65 return mock_ptr_type(
wchar_t *);
68DWORD __wrap_GetLastError() {
69 return mock_type(DWORD);
72int __wrap__wchdir(
const wchar_t *dirname) {
73 return mock_type(
int);
76bool __wrap_CloseHandle(HANDLE hObject) {
77 return mock_type(
bool);
80bool __wrap_CreateProcess(LPCWSTR lpApplicationName,
82 LPSECURITY_ATTRIBUTES lpProcessAttributes,
83 LPSECURITY_ATTRIBUTES lpThreadAttributes,
85 DWORD dwCreationFlags,
87 LPCWSTR lpCurrentDirectory,
88 LPSTARTUPINFO lpStartupInfo,
89 LPPROCESS_INFORMATION lpProcessInformation) {
90 return mock_type(
bool);
93bool __wrap_WriteFile(HANDLE hFile,
95 DWORD nNumberOfBytesToWrite,
96 LPDWORD lpNumberOfBytesWritten,
97 LPOVERLAPPED lpOverlapped) {
98 check_expected(nNumberOfBytesToWrite);
99 *lpNumberOfBytesWritten = mock_type(DWORD);
100 return mock_type(
bool);
103HANDLE __wrap_GetStdHandle(DWORD nStdHandle) {
104 return mock_ptr_type(HANDLE);
107int __wrap_MultiByteToWideChar(UINT CodePage,
109 LPCCH lpMultiByteStr,
111 LPWSTR lpWideCharStr,
113 check_expected(cchWideChar);
114 wchar_t *wc_ret = mock_ptr_type(
wchar_t *);
115 if (lpWideCharStr && wc_ret) {
116 wmemcpy(lpWideCharStr, wc_ret, (
size_t)cchWideChar);
118 return mock_type(
int);
121int __wrap_WideCharToMultiByte(UINT CodePage,
123 LPCWCH lpWideCharStr,
125 LPSTR lpMultiByteStr,
128 bool *lpUsedDefaultChar) {
129 return mock_type(
int);
132void __wrap_PathStripPath(LPWSTR pszPath) {
135LSTATUS __wrap_RegEnumValue(HKEY hKey,
138 LPDWORD lpcchValueName,
143 return mock_type(LSTATUS);
146DWORD __wrap_WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) {
147 return mock_type(DWORD);
150bool __wrap_PeekNamedPipe(HANDLE hNamedPipe,
154 LPDWORD lpTotalBytesAvail,
155 LPDWORD lpBytesLeftThisMessage) {
156 *lpTotalBytesAvail = mock_type(DWORD);
157 return mock_type(
bool);
160bool __wrap_ReadFile(HANDLE hFile,
162 DWORD nNumberOfBytesToRead,
163 LPDWORD lpNumberOfBytesRead,
164 LPOVERLAPPED lpOverlapped) {
165 lpBuffer = mock_ptr_type(
char *);
166 *lpNumberOfBytesRead = mock_type(DWORD);
167 return mock_type(
bool);
170HANDLE __wrap_CreateFile(LPCWSTR lpFileName,
171 DWORD dwDesiredAccess,
173 LPSECURITY_ATTRIBUTES lpSecurityAttributes,
174 DWORD dwCreationDisposition,
175 DWORD dwFlagsAndAttributes,
176 HANDLE hTemplateFile) {
177 return mock_ptr_type(HANDLE);
180LSTATUS __wrap_RegEnumKeyEx(HKEY hKey,
187 PFILETIME lpftLastWriteTime) {
188 wchar_t *name = mock_ptr_type(
wchar_t *);
190 wmemcpy(lpName, name, wcslen(name));
192 *lpcchName = mock_type(DWORD);
193 return mock_type(LSTATUS);
196LSTATUS __wrap_RegQueryInfoKey(HKEY hKey,
201 LPDWORD lpcbMaxSubKeyLen,
202 LPDWORD lpcbMaxClassLen,
204 LPDWORD lpcbMaxValueNameLen,
205 LPDWORD lpcbMaxValueLen,
206 LPDWORD lpcbSecurityDescriptor,
207 PFILETIME lpftLastWriteTime) {
208 *lpcSubKeys = mock_type(DWORD);
209 return mock_type(LSTATUS);
212LSTATUS __wrap_RegQueryValueEx(HKEY hKey,
218 return mock_type(LSTATUS);
221DWORD __wrap_GetFileAttributes(
wchar_t *path) {
222 return mock_type(DWORD);
225bool __wrap_CreatePipe(PHANDLE hReadPipe,
227 LPSECURITY_ATTRIBUTES lpPipeAttributes,
229 return mock_type(
bool);
232wchar_t *__wrap__wgetcwd(
wchar_t *buffer,
int maxlen) {
233 return mock_ptr_type(
wchar_t *);
238 HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult) {
239 return mock_type(LSTATUS);
242bool __wrap_CreateDirectory(LPCWSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) {
243 return mock_type(
bool);
246bool __wrap_PathAppend(LPWSTR pszPath, LPCWSTR pszMore) {
247 LPCWSTR newPszPath = mock_ptr_type(LPWSTR);
249 wmemcpy(pszPath, newPszPath, wcslen(newPszPath));
251 return mock_type(
bool);
254DWORD __wrap_FormatMessage(DWORD dwFlags,
260 va_list *Arguments) {
262 return mock_type(DWORD);
265bool __wrap__CrtDumpMemoryLeaks() {
270__wrap_SHGetFolderPath(HWND hwnd,
int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath) {
271 LPWSTR newPszPath = mock_ptr_type(LPWSTR);
272 wmemcpy(pszPath, newPszPath, wcslen(newPszPath));
273 return mock_type(HRESULT);
276int _snwprintf(
wchar_t *buffer,
size_t count,
const wchar_t *format, ...) {
279 va_start(args, format);
280 if (!buffer && count == 0) {
282 ret = vswprintf(buf, 10240, format, args);
284 ret = vswprintf(buffer, count, format, args);
290bool __wrap_write_output(
wchar_t *out,
bool use_crlf, writer_t *writer) {
292 return mock_type(
bool);
295bool __wrap_do_write_reg_command(writer_t *writer,
296 const wchar_t *full_path,
300 unsigned long type) {
301 return mock_type(
bool);
304bool __wrap_do_write_c_reg_code(writer_t *writer,
305 const wchar_t *full_path,
309 unsigned long type) {
310 return mock_type(
bool);
313bool __wrap_do_write_c_sharp_reg_code(writer_t *writer,
314 const wchar_t *full_path,
318 unsigned long type) {
319 return mock_type(
bool);
322bool __wrap_do_write_powershell_reg_code(writer_t *writer,
323 const wchar_t *full_path,
327 unsigned long type) {
328 return mock_type(
bool);
331bool __wrap_write_key_filtered_recursive(HKEY hk,
335 const wchar_t *prior_stem,
336 enum OUTPUT_FORMAT format,
338 return mock_type(
bool);
341bool __wrap_git_commit(
wchar_t *output_dir,
wchar_t *deploy_key) {
342 return mock_type(
bool);
345bool __wrap_GetExitCodeProcess(HANDLE hProcess, LPDWORD lpExitCode) {
346 *lpExitCode = mock_type(DWORD);
347 return mock_type(
bool);