VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h@ 84533

Last change on this file since 84533 was 83033, checked in by vboxsync, 5 years ago

/Config.kmk,/Makefile.kmk,Installer/darwin,FE/QT,SUPHard: Eliminated the symlinks under Resources/VirtualBoxVM.app to avoid confusing codesign and notarization. bugref:9466
Note! Best to do a clean build on mac (or at a minimum rm -Rf out/darwin.amd64/*/dist/VirtualBox.app/Contents/Frameworks/ out/darwin.amd64/*/dist/VirtualBox.app/Contents/plugins/).

  • SUPHard: Added new location SUPSECMAIN_FLAGS_LOC_OSX_HLP_APP (darwin only) for indicating a helper application and that hardened dylib and the rest of VirtualBox isn't in the executable directory.
  • SUPHard: Added a corresponding internal path ID kSupID_AppMacHelper (darwin only) for finding VirtualBoxVM for verification now that it is no longer in the main app binary directory.
  • /Config.kmk: Run install_name_tool after linking Qt binaries on darwin fix the Qt import paths (@executable_path/../Frameworks/ doesn't work for VirtualBoxVM any more).
  • /Makefile.kmk: Run install_name_tool during installation of Qt frameworks and plugins to use @rpath in non-hardened builds and the absolute paths in hardened ones (latter done by Installer/darwin/Makefile.kmk previously).
  • FE/Qt,Installer/darwin: Adjustments and path hacks.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 19.1 KB
Line 
1/* $Id: SUPLibInternal.h 83033 2020-02-10 13:40:54Z vboxsync $ */
2/** @file
3 * VirtualBox Support Library - Internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2020 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#ifndef VBOX_INCLUDED_SRC_Support_SUPLibInternal_h
28#define VBOX_INCLUDED_SRC_Support_SUPLibInternal_h
29#ifndef RT_WITHOUT_PRAGMA_ONCE
30# pragma once
31#endif
32
33#include <VBox/cdefs.h>
34#include <VBox/types.h>
35#include <iprt/stdarg.h>
36
37
38/*******************************************************************************
39* Defined Constants And Macros *
40*******************************************************************************/
41/** @def SUPLIB_DLL_SUFF
42 * The (typical) DLL/DYLIB/SO suffix. */
43#if defined(RT_OS_DARWIN)
44# define SUPLIB_DLL_SUFF ".dylib"
45#elif defined(RT_OS_L4)
46# define SUPLIB_DLL_SUFF ".s.so"
47#elif defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
48# define SUPLIB_DLL_SUFF ".dll"
49#else
50# define SUPLIB_DLL_SUFF ".so"
51#endif
52
53#ifdef RT_OS_SOLARIS
54/** Number of dummy files to open (2:ip4, 1:ip6, 1:extra) see
55 * @bugref{4650}. */
56# define SUPLIB_FLT_DUMMYFILES 4
57#endif
58
59/** @def SUPLIB_EXE_SUFF
60 * The (typical) executable suffix. */
61#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
62# define SUPLIB_EXE_SUFF ".exe"
63#else
64# define SUPLIB_EXE_SUFF ""
65#endif
66
67/** @def SUP_HARDENED_SUID
68 * Whether we're employing set-user-ID-on-execute in the hardening.
69 */
70#if (!defined(RT_OS_OS2) && !defined(RT_OS_WINDOWS) && !defined(RT_OS_L4)) || defined(DOXYGEN_RUNNING)
71# define SUP_HARDENED_SUID
72#else
73# undef SUP_HARDENED_SUID
74#endif
75
76#ifdef IN_SUP_HARDENED_R3
77/** @name Make the symbols in SUPR3HardenedStatic different from the VBoxRT ones.
78 * We cannot rely on DECLHIDDEN to make this separation for us since it doesn't
79 * work with all GCC versions. So, we resort to old fashion precompiler hacking.
80 * @{
81 */
82# define supR3HardenedPathAppPrivateNoArch supR3HardenedStaticPathAppPrivateNoArch
83# define supR3HardenedPathAppPrivateArch supR3HardenedStaticPathAppPrivateArch
84# define supR3HardenedPathAppSharedLibs supR3HardenedStaticPathAppSharedLibs
85# define supR3HardenedPathAppDocs supR3HardenedStaticPathAppDocs
86# define supR3HardenedPathAppBin supR3HardenedStaticPathAppBin
87# define supR3HardenedPathFilename supR3HardenedStaticPathFilename
88# define supR3HardenedFatalV supR3HardenedStaticFatalV
89# define supR3HardenedFatal supR3HardenedStaticFatal
90# define supR3HardenedFatalMsgV supR3HardenedStaticFatalMsgV
91# define supR3HardenedFatalMsg supR3HardenedStaticFatalMsg
92# define supR3HardenedErrorV supR3HardenedStaticErrorV
93# define supR3HardenedError supR3HardenedStaticError
94# define supR3HardenedOpenLog supR3HardenedStaticOpenLog
95# define supR3HardenedLogV supR3HardenedStaticLogV
96# define supR3HardenedLog supR3HardenedStaticLog
97# define supR3HardenedLogFlush supR3HardenedStaticLogFlush
98# define supR3HardenedVerifyAll supR3HardenedStaticVerifyAll
99# define supR3HardenedVerifyFixedDir supR3HardenedStaticVerifyFixedDir
100# define supR3HardenedVerifyFixedFile supR3HardenedStaticVerifyFixedFile
101# define supR3HardenedVerifyDir supR3HardenedStaticVerifyDir
102# define supR3HardenedVerifyFile supR3HardenedStaticVerifyFile
103# define supR3HardenedGetPreInitData supR3HardenedStaticGetPreInitData
104# define supR3HardenedRecvPreInitData supR3HardenedStaticRecvPreInitData
105/** @} */
106#endif /* IN_SUP_HARDENED_R3 */
107
108
109/** @name CRT function mappings (not using CRT on Windows).
110 * @{
111 */
112#if defined(IN_SUP_HARDENED_R3) && defined(RT_OS_WINDOWS)
113# define SUP_HARDENED_NEED_CRT_FUNCTIONS
114DECLHIDDEN(int) suplibHardenedMemComp(void const *pvDst, const void *pvSrc, size_t cbToComp);
115DECLHIDDEN(void *) suplibHardenedMemCopy(void *pvDst, const void *pvSrc, size_t cbToCopy);
116DECLHIDDEN(void *) suplibHardenedMemSet(void *pvDst, int ch, size_t cbToSet);
117DECLHIDDEN(char *) suplibHardenedStrCopy(char *pszDst, const char *pszSrc);
118DECLHIDDEN(size_t) suplibHardenedStrLen(const char *psz);
119DECLHIDDEN(char *) suplibHardenedStrCat(char *pszDst, const char *pszSrc);
120DECLHIDDEN(int) suplibHardenedStrCmp(const char *psz1, const char *psz2);
121DECLHIDDEN(int) suplibHardenedStrNCmp(const char *psz1, const char *psz2, size_t cchMax);
122#else
123# undef SUP_HARDENED_NEED_CRT_FUNCTIONS
124# define suplibHardenedMemComp memcmp
125# define suplibHardenedMemCopy memcpy
126# define suplibHardenedMemSet memset
127# define suplibHardenedStrCopy strcpy
128# define suplibHardenedStrLen strlen
129# define suplibHardenedStrCat strcat
130# define suplibHardenedStrCmp strcmp
131# define suplibHardenedStrNCmp strncmp
132#endif
133DECLNORETURN(void) suplibHardenedExit(RTEXITCODE rcExit);
134DECLHIDDEN(void) suplibHardenedPrintF(const char *pszFormat, ...);
135DECLHIDDEN(void) suplibHardenedPrintFV(const char *pszFormat, va_list va);
136
137/** @} */
138
139/** Debug output macro. */
140#ifdef IN_SUP_HARDENED_R3
141# if defined(DEBUG_bird) && defined(RT_OS_WINDOWS)
142# define SUP_DPRINTF(a) do { supR3HardenedStaticLog a; suplibHardenedPrintF a; } while (0)
143# else
144# define SUP_DPRINTF(a) do { supR3HardenedStaticLog a; } while (0)
145# endif
146#else
147# if defined(DEBUG_bird) && defined(RT_OS_WINDOWS)
148# define SUP_DPRINTF(a) RTLogPrintf a
149# else
150# define SUP_DPRINTF(a) do { } while (0)
151# endif
152#endif
153
154
155/*******************************************************************************
156* Structures and Typedefs *
157*******************************************************************************/
158/**
159 * The type of an installed file.
160 */
161typedef enum SUPINSTFILETYPE
162{
163 kSupIFT_Invalid = 0,
164 kSupIFT_Exe,
165 kSupIFT_Dll,
166 kSupIFT_Rc,
167 kSupIFT_Sys,
168 kSupIFT_Script,
169 kSupIFT_Data,
170 kSupIFT_TestExe,
171 kSupIFT_TestDll,
172 kSupIFT_End
173} SUPINSTFILETYPE;
174
175/**
176 * Installation directory specifier.
177 */
178typedef enum SUPINSTDIR
179{
180 kSupID_Invalid = 0,
181 kSupID_AppBin,
182 kSupID_AppSharedLib,
183 kSupID_AppPrivArch,
184 kSupID_AppPrivArchComp,
185 kSupID_AppPrivNoArch,
186 kSupID_Testcase,
187#ifdef RT_OS_DARWIN
188 kSupID_AppMacHelper,
189#endif
190 kSupID_End
191} SUPINSTDIR;
192
193/**
194 * Installed file.
195 */
196typedef struct SUPINSTFILE
197{
198 /** File type. */
199 SUPINSTFILETYPE enmType;
200 /** Install directory. */
201 SUPINSTDIR enmDir;
202 /** Optional (true) or mandatory (false. */
203 bool fOptional;
204 /** File name. */
205 const char *pszFile;
206} SUPINSTFILE;
207typedef SUPINSTFILE *PSUPINSTFILE;
208typedef SUPINSTFILE const *PCSUPINSTFILE;
209
210/**
211 * Status data for a verified file.
212 */
213typedef struct SUPVERIFIEDFILE
214{
215 /** The file handle or descriptor. -1 if not open. */
216 intptr_t hFile;
217 /** Whether the file has been validated. */
218 bool fValidated;
219#ifdef RT_OS_WINDOWS
220 /** Whether we've checked the signature of the file. */
221 bool fCheckedSignature;
222#endif
223} SUPVERIFIEDFILE;
224typedef SUPVERIFIEDFILE *PSUPVERIFIEDFILE;
225typedef SUPVERIFIEDFILE const *PCSUPVERIFIEDFILE;
226
227/**
228 * Status data for a verified directory.
229 */
230typedef struct SUPVERIFIEDDIR
231{
232 /** The directory handle or descriptor. -1 if not open. */
233 intptr_t hDir;
234 /** Whether the directory has been validated. */
235 bool fValidated;
236} SUPVERIFIEDDIR;
237typedef SUPVERIFIEDDIR *PSUPVERIFIEDDIR;
238typedef SUPVERIFIEDDIR const *PCSUPVERIFIEDDIR;
239
240
241/**
242 * SUPLib instance data.
243 *
244 * This is data that is passed from the static to the dynamic SUPLib
245 * in a hardened setup.
246 */
247typedef struct SUPLIBDATA
248{
249 /** The device handle. */
250#if defined(RT_OS_WINDOWS)
251 void *hDevice;
252#else
253 int hDevice;
254#endif
255 /** Indicates whether we have unrestricted (true) or restricted access to the
256 * support device. */
257 bool fUnrestricted;
258#if defined(RT_OS_DARWIN)
259 /** The connection to the VBoxSupDrv service. */
260 uintptr_t uConnection;
261#elif defined(RT_OS_LINUX)
262 /** Indicates whether madvise(,,MADV_DONTFORK) works. */
263 bool fSysMadviseWorks;
264#elif defined(RT_OS_SOLARIS)
265 /** Extra dummy file descriptors to prevent growing file-descriptor table on
266 * clean up (see @bugref{4650}). */
267 int ahDummy[SUPLIB_FLT_DUMMYFILES];
268#elif defined(RT_OS_WINDOWS)
269#endif
270} SUPLIBDATA;
271/** Pointer to the pre-init data. */
272typedef SUPLIBDATA *PSUPLIBDATA;
273/** Pointer to const pre-init data. */
274typedef SUPLIBDATA const *PCSUPLIBDATA;
275
276/** The NIL value of SUPLIBDATA::hDevice. */
277#if defined(RT_OS_WINDOWS)
278# define SUP_HDEVICE_NIL NULL
279#else
280# define SUP_HDEVICE_NIL (-1)
281#endif
282
283
284/**
285 * Pre-init data that is handed over from the hardened executable stub.
286 */
287typedef struct SUPPREINITDATA
288{
289 /** Magic value (SUPPREINITDATA_MAGIC). */
290 uint32_t u32Magic;
291 /** The SUPLib instance data. */
292 SUPLIBDATA Data;
293 /** The number of entries in paInstallFiles and paVerifiedFiles. */
294 size_t cInstallFiles;
295 /** g_aSupInstallFiles. */
296 PCSUPINSTFILE paInstallFiles;
297 /** g_aSupVerifiedFiles. */
298 PCSUPVERIFIEDFILE paVerifiedFiles;
299 /** The number of entries in paVerifiedDirs. */
300 size_t cVerifiedDirs;
301 /** g_aSupVerifiedDirs. */
302 PCSUPVERIFIEDDIR paVerifiedDirs;
303 /** Magic value (SUPPREINITDATA_MAGIC). */
304 uint32_t u32EndMagic;
305} SUPPREINITDATA;
306typedef SUPPREINITDATA *PSUPPREINITDATA;
307typedef SUPPREINITDATA const *PCSUPPREINITDATA;
308
309/** Magic value for SUPPREINITDATA::u32Magic and SUPPREINITDATA::u32EndMagic. */
310#define SUPPREINITDATA_MAGIC UINT32_C(0xbeef0001)
311
312/** @copydoc supR3PreInit */
313typedef DECLCALLBACK(int) FNSUPR3PREINIT(PSUPPREINITDATA pPreInitData, uint32_t fFlags);
314/** Pointer to supR3PreInit. */
315typedef FNSUPR3PREINIT *PFNSUPR3PREINIT;
316
317/** The current SUPR3HardenedMain state / location. */
318typedef enum SUPR3HARDENEDMAINSTATE
319{
320 SUPR3HARDENEDMAINSTATE_NOT_YET_CALLED = 0,
321 SUPR3HARDENEDMAINSTATE_WIN_EARLY_INIT_CALLED,
322 SUPR3HARDENEDMAINSTATE_WIN_EARLY_IMPORTS_RESOLVED,
323 SUPR3HARDENEDMAINSTATE_WIN_EARLY_STUB_DEVICE_OPENED,
324 SUPR3HARDENEDMAINSTATE_WIN_EARLY_REAL_DEVICE_OPENED,
325 SUPR3HARDENEDMAINSTATE_WIN_EP_CALLED,
326 SUPR3HARDENEDMAINSTATE_WIN_IMPORTS_RESOLVED,
327 SUPR3HARDENEDMAINSTATE_WIN_VERSION_INITIALIZED,
328 SUPR3HARDENEDMAINSTATE_WIN_VERIFY_TRUST_READY,
329 SUPR3HARDENEDMAINSTATE_HARDENED_MAIN_CALLED,
330 SUPR3HARDENEDMAINSTATE_INIT_RUNTIME,
331 SUPR3HARDENEDMAINSTATE_GET_TRUSTED_MAIN,
332 SUPR3HARDENEDMAINSTATE_CALLED_TRUSTED_MAIN,
333 SUPR3HARDENEDMAINSTATE_END,
334 SUPR3HARDENEDMAINSTATE_32BIT_HACK = 0x7fffffff
335} SUPR3HARDENEDMAINSTATE;
336
337
338/*******************************************************************************
339* Global Variables *
340*******************************************************************************/
341extern DECLHIDDEN(uint32_t) g_u32Cookie;
342extern DECLHIDDEN(uint32_t) g_u32SessionCookie;
343extern DECLHIDDEN(SUPLIBDATA) g_supLibData;
344extern DECLHIDDEN(uint32_t) g_uSupFakeMode;
345extern DECLHIDDEN(PSUPGLOBALINFOPAGE) g_pSUPGlobalInfoPageR0;
346#ifdef VBOX_INCLUDED_SRC_Support_SUPDrvIOC_h
347extern DECLHIDDEN(PSUPQUERYFUNCS) g_pSupFunctions;
348#endif
349extern DECLHIDDEN(SUPR3HARDENEDMAINSTATE) g_enmSupR3HardenedMainState;
350#ifdef RT_OS_WINDOWS
351extern DECLHIDDEN(bool) g_fSupEarlyProcessInit;
352#endif
353
354
355/*******************************************************************************
356* OS Specific Function *
357*******************************************************************************/
358RT_C_DECLS_BEGIN
359int suplibOsInstall(void);
360int suplibOsUninstall(void);
361int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted, SUPINITOP *penmWhat, PRTERRINFO pErrInfo);
362int suplibOsTerm(PSUPLIBDATA pThis);
363int suplibOsHardenedVerifyInit(void);
364int suplibOsHardenedVerifyTerm(void);
365int suplibOsIOCtl(PSUPLIBDATA pThis, uintptr_t uFunction, void *pvReq, size_t cbReq);
366int suplibOsIOCtlFast(PSUPLIBDATA pThis, uintptr_t uFunction, uintptr_t idCpu);
367int suplibOsPageAlloc(PSUPLIBDATA pThis, size_t cPages, void **ppvPages);
368int suplibOsPageFree(PSUPLIBDATA pThis, void *pvPages, size_t cPages);
369int suplibOsQueryVTxSupported(const char **ppszWhy);
370bool suplibOsIsNemSupportedWhenNoVtxOrAmdV(void);
371
372
373/**
374 * Performs the pre-initialization of the support library.
375 *
376 * This is dynamically resolved and invoked by the static library before it
377 * calls RTR3InitEx and thereby SUPR3Init.
378 *
379 * @returns IPRT status code.
380 * @param pPreInitData The pre init data.
381 * @param fFlags The SUPR3HardenedMain flags.
382 */
383DECLEXPORT(int) supR3PreInit(PSUPPREINITDATA pPreInitData, uint32_t fFlags);
384
385
386/** @copydoc RTPathAppPrivateNoArch */
387DECLHIDDEN(int) supR3HardenedPathAppPrivateNoArch(char *pszPath, size_t cchPath);
388/** @copydoc RTPathAppPrivateArch */
389DECLHIDDEN(int) supR3HardenedPathAppPrivateArch(char *pszPath, size_t cchPath);
390/** @copydoc RTPathSharedLibs */
391DECLHIDDEN(int) supR3HardenedPathAppSharedLibs(char *pszPath, size_t cchPath);
392/** @copydoc RTPathAppDocs */
393DECLHIDDEN(int) supR3HardenedPathAppDocs(char *pszPath, size_t cchPath);
394/** @copydoc RTPathExecDir */
395DECLHIDDEN(int) supR3HardenedPathAppBin(char *pszPath, size_t cchPath);
396/** @copydoc RTPathFilename */
397DECLHIDDEN(char *) supR3HardenedPathFilename(const char *pszPath);
398
399/**
400 * Display a fatal error and try call TrustedError or quit.
401 */
402DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsgV(const char *pszWhere, SUPINITOP enmWhat, int rc,
403 const char *pszMsgFmt, va_list va);
404
405/**
406 * Display a fatal error and try call TrustedError or quit.
407 */
408DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalMsg(const char *pszWhere, SUPINITOP enmWhat, int rc,
409 const char *pszMsgFmt, ...);
410
411/**
412 * Display a fatal error and quit.
413 */
414DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatalV(const char *pszFormat, va_list va);
415
416/**
417 * Display a fatal error and quit.
418 */
419DECL_NO_RETURN(DECLHIDDEN(void)) supR3HardenedFatal(const char *pszFormat, ...);
420
421/**
422 * Display an error which may or may not be fatal.
423 */
424DECLHIDDEN(int) supR3HardenedErrorV(int rc, bool fFatal, const char *pszFormat, va_list va);
425
426/**
427 * Display an error which may or may not be fatal.
428 */
429DECLHIDDEN(int) supR3HardenedError(int rc, bool fFatal, const char *pszFormat, ...);
430
431/**
432 * Open any startup log file specified in the argument.
433 */
434DECLHIDDEN(void) supR3HardenedOpenLog(int *pcArgs, char **papszArgs);
435
436/**
437 * Write to the startup log file.
438 */
439DECLHIDDEN(void) supR3HardenedLogV(const char *pszFormat, va_list va);
440
441/**
442 * Write to the startup log file.
443 */
444DECLHIDDEN(void) supR3HardenedLog(const char *pszFormat, ...);
445
446/**
447 * Flushes the log file.
448 */
449DECLHIDDEN(void) supR3HardenedLogFlush(void);
450
451
452DECLHIDDEN(int) supR3HardenedVerifyAll(bool fFatal, const char *pszProgName, const char *pszExePath, uint32_t fMainFlags);
453DECLHIDDEN(int) supR3HardenedVerifyFixedDir(SUPINSTDIR enmDir, bool fFatal, PCSUPINSTFILE pFile);
454DECLHIDDEN(int) supR3HardenedVerifyFixedFile(const char *pszFilename, bool fFatal);
455DECLHIDDEN(int) supR3HardenedVerifyDir(const char *pszDirPath, bool fRecursive, bool fCheckFiles, PRTERRINFO pErrInfo);
456DECLHIDDEN(int) supR3HardenedVerifyFile(const char *pszFilename, RTHCUINTPTR hNativeFile, bool fMaybe3rdParty,
457 PRTERRINFO pErrInfo);
458#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX)
459DECLHIDDEN(int) supR3HardenedVerifyFileFollowSymlinks(const char *pszFilename, RTHCUINTPTR hNativeFile, bool fMaybe3rdParty,
460 PRTERRINFO pErrInfo);
461#endif
462DECLHIDDEN(void) supR3HardenedGetPreInitData(PSUPPREINITDATA pPreInitData);
463DECLHIDDEN(int) supR3HardenedRecvPreInitData(PCSUPPREINITDATA pPreInitData);
464
465#ifdef RT_OS_WINDOWS
466DECLHIDDEN(void) supR3HardenedWinInit(uint32_t fFlags, bool fAvastKludge);
467DECLHIDDEN(void) supR3HardenedWinInitAppBin(uint32_t fFlags);
468DECLHIDDEN(void) supR3HardenedWinInitVersion(bool fEarlyInit);
469DECLHIDDEN(void) supR3HardenedWinInitImports(void);
470DECLHIDDEN(void) supR3HardenedWinModifyDllSearchPath(uint32_t fFlags, const char *pszAppBinPath);
471# ifdef IPRT_INCLUDED_nt_nt_h
472DECLHIDDEN(void) supR3HardenedWinGetVeryEarlyImports(uintptr_t uNtDllAddr,
473 PFNNTWAITFORSINGLEOBJECT *ppfnNtWaitForSingleObject,
474 PFNNTSETEVENT *ppfnNtSetEvent);
475# endif
476DECLHIDDEN(void) supR3HardenedWinInitImportsEarly(uintptr_t uNtDllAddr);
477DECLHIDDEN(void) supR3HardenedWinInitSyscalls(bool fReportErrors, PRTERRINFO pErrInfo);
478DECLHIDDEN(PFNRT) supR3HardenedWinGetRealDllSymbol(const char *pszDll, const char *pszProcedure);
479DECLHIDDEN(void) supR3HardenedWinEnableThreadCreation(void);
480DECLHIDDEN(void) supR3HardenedWinResolveVerifyTrustApiAndHookThreadCreation(const char *pszProgName);
481DECLHIDDEN(void) supR3HardenedWinFlushLoaderCache();
482DECLHIDDEN(bool) supR3HardenedWinIsReSpawnNeeded(int iWhich, int cArgs, char **papszArgs);
483DECLHIDDEN(int) supR3HardenedWinReSpawn(int iWhich);
484# ifdef _WINDEF_
485DECLHIDDEN(void) supR3HardenedWinCreateParentWatcherThread(HMODULE hVBoxRT);
486# endif
487DECLHIDDEN(void *) supR3HardenedWinLoadLibrary(const char *pszName, bool fSystem32Only, uint32_t fMainFlags);
488extern RTUTF16 g_wszSupLibHardenedExePath[1024];
489# ifdef RTPATH_MAX
490extern char g_szSupLibHardenedExePath[RTPATH_MAX];
491# endif
492DECLHIDDEN(void) supR3HardenedWinCompactHeaps(void);
493DECLHIDDEN(void) supR3HardenedMainOpenDevice(void);
494DECLHIDDEN(char *) supR3HardenedWinReadErrorInfoDevice(char *pszErrorInfo, size_t cbErrorInfo, const char *pszPrefix);
495DECLHIDDEN(void) supR3HardenedWinReportErrorToParent(const char *pszWhere, SUPINITOP enmWhat, int rc,
496 const char *pszFormat, va_list va);
497#else /* !RT_OS_WINDOWS */
498DECLHIDDEN(void) supR3HardenedPosixInit(void);
499#endif /* !RT_OS_WINDOWS */
500
501SUPR3DECL(int) supR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages);
502SUPR3DECL(int) supR3PageUnlock(void *pvStart);
503
504RT_C_DECLS_END
505
506
507#endif /* !VBOX_INCLUDED_SRC_Support_SUPLibInternal_h */
508
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette