Advertisement
Guest User

Untitled

a guest
Jan 13th, 2018
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.32 KB | None | 0 0
  1. // Copyright (c) Softanics
  2. //
  3. // BoxedApp SDK
  4. //
  5. // Ask your questions here: http://boxedapp.com/support.html
  6. // Our forum: http://boxedapp.com/forum/
  7. // License SDK: http://boxedapp.com/boxedappsdk/order.html
  8. // Online help: http://boxedapp.com/boxedappsdk/help/
  9. //
  10.  
  11. #ifndef __BOXEDAPPSDK_H__
  12. #define __BOXEDAPPSDK_H__
  13.  
  14. #define BOXEDAPPSDKAPI __stdcall
  15.  
  16. #include <pshpack4.h>
  17.  
  18. // IStream* declaration
  19. #include <objidl.h>
  20.  
  21. #ifndef DEF_BOXEDAPPSDK_INTERFACES_NOT_REQUIRED
  22. #include "BoxedAppSDK_Interfaces.h"
  23. #endif // !DEF_BOXEDAPPSDK_INTERFACES_NOT_REQUIRED
  24.  
  25. #ifdef __cplusplus
  26. extern "C"
  27. {
  28. #endif
  29.  
  30. // Options
  31. #define DEF_BOXEDAPPSDK_OPTION__ALL_CHANGES_ARE_VIRTUAL (1) // default: 0 (FALSE)
  32. #define DEF_BOXEDAPPSDK_OPTION__EMBED_BOXEDAPP_IN_CHILD_PROCESSES (2) // default: 0 (FALSE, don't enable BoxedApp to a new process by default)
  33. #define DEF_BOXEDAPPSDK_OPTION__ENABLE_VIRTUAL_FILE_SYSTEM (3) // default: 1 (TRUE)
  34. #define DEF_BOXEDAPPSDK_OPTION__RECREATE_VIRTUAL_FILE_AS_VIRTUAL (4) // default: 1 (TRUE)
  35. #define DEF_BOXEDAPPSDK_OPTION__ENABLE_VIRTUAL_REGISTRY (5) // default: 1 (TRUE)
  36. #define DEF_BOXEDAPPSDK_OPTION__HIDE_VIRTUAL_FILES_FROM_FILE_DIALOG (6) // default: 0 (FALSE)
  37. #define DEF_BOXEDAPPSDK_OPTION__EMULATE_OUT_OF_PROC_COM_SERVERS (7) // default: 0 (FALSE)
  38. #define DEF_BOXEDAPPSDK_OPTION__INHERIT_OPTIONS (8) // default: 1 (FALSE)
  39. #define DEF_BOXEDAPPSDK_OPTION__ENABLE_REGISTRY_RMSC_REDIRECTOR (9) // default: 0 (FALSE)
  40. #define DEF_BOXEDAPPSDK_OPTION__ENABLE_ALL_HOOKS (10) // default: 1 (TRUE)
  41. #define DEF_BOXEDAPPSDK_OPTION__NTACCESSCHECK_ALWAYS_RETURNS_SUCCESS (11) // default: 0 (FALSE)
  42. #define DEF_BOXEDAPPSDK_OPTION__ENABLE_EXPERIMENTAL_IMPORT_PROCESSING (12) // default: 0 (FALSE)
  43.  
  44. // Startup flags
  45. #define DEF_BOXEDAPPSDK_STARTUP_OPTION__HOOK_ENGINE (1) // default: 0 (FALSE)
  46.  
  47. /// Isolation mode enumeration
  48. typedef enum _BX_ISOLATION_MODE
  49. {
  50. // No isolation specified
  51. BxIsolationMode_None,
  52.  
  53. // File system:
  54. //
  55. // When enumerating, process views files from the destination directory only
  56. // Modifications of files in the destination directory are saved in the destination directory
  57. // Files from the source directory are not reading or writing
  58. // New files are created in the destination directory
  59. //
  60. // Registry:
  61. //
  62. // Process works with virtual registry only, reading and writing are passed
  63. // virtual registry only; real registry is not asked at all
  64. BxIsolationMode_Full,
  65.  
  66. // When enumerating, process views files from source
  67. // directory plus files from destination directory,
  68. // but if the same files are in both, then file in
  69. // the destination directory gets priority
  70. //
  71. // Modifications of files in the destination directory
  72. // are saved in the destination directory
  73. //
  74. // Modifications of files in the source directory are
  75. // saved to this files
  76. //
  77. // New files are created in the destination directory
  78. //
  79. // Registry:
  80. //
  81. // Process views subkeys / values of virtual registry and real registry; if keys are present
  82. // in both registries, the key of virtual registry is included
  83. //
  84. // New keys are created in virtual registry
  85. BxIsolationMode_Merged,
  86.  
  87. // When enumerating, process views files from source
  88. // directory plus files from destination directory,
  89. // but if the same files are in both, then file in
  90. // the destination directory gets priority
  91. //
  92. // Modifications of files in the destination directory
  93. // are saved in the destination directory
  94. //
  95. // Modifications of files in the source directory are
  96. // saved to the destination directory
  97. //
  98. // New files are created in the destination directory
  99. //
  100. // Registry:
  101. //
  102. // Process views subkeys / values of virtual registry and real registry; if keys are present
  103. // in both registries, the key of virtual registry is included
  104. //
  105. // New keys are created in virtual registry
  106. //
  107. // If real real is opened and one writes to the key, the virtual key is created; so real
  108. // registry is not changed
  109. BxIsolationMode_WriteCopy
  110. } BX_ISOLATION_MODE;
  111.  
  112. void WINAPI BoxedAppSDK_PackerStubEntryPoint(HMODULE, PVOID, DWORD);
  113.  
  114. // Initialization
  115. BOOL BOXEDAPPSDKAPI BoxedAppSDK_Init();
  116. // Internal: initialization by environment id
  117. BOOL BOXEDAPPSDKAPI BoxedAppSDK_InitById(ULONGLONG nEnvId);
  118. // Finalization
  119. void BOXEDAPPSDKAPI BoxedAppSDK_Exit();
  120.  
  121. /// A structure that is used for EnumBoxedAppSDK_RequestId__RedirectFilePath
  122. struct SBoxedAppSDK__RedirectFilePath
  123. {
  124. // in
  125. LPCWSTR m_szPath;
  126.  
  127. // out
  128. BOOL m_bHandled;
  129.  
  130. LPWSTR m_szRedirectToPath;
  131. };
  132.  
  133. // Internal: this function is called by rundll32.exe when this is used as a helper process
  134. void CALLBACK BoxedAppSDK_RunDll32_Callback();
  135.  
  136. // Enable / disable logging
  137. void BOXEDAPPSDKAPI BoxedAppSDK_EnableDebugLog(BOOL bEnable);
  138.  
  139. // Log file
  140. void BOXEDAPPSDKAPI BoxedAppSDK_SetLogFileA(LPCSTR szLogFilePath);
  141. void BOXEDAPPSDKAPI BoxedAppSDK_SetLogFileW(LPCWSTR szLogFilePath);
  142.  
  143. #ifdef UNICODE
  144. #define BoxedAppSDK_SetLogFile BoxedAppSDK_SetLogFileW
  145. #else
  146. #define BoxedAppSDK_SetLogFile BoxedAppSDK_SetLogFileA
  147. #endif // UNICODE
  148.  
  149. void WINAPI BoxedAppSDK_WriteLogA(LPCSTR szMessage);
  150. void WINAPI BoxedAppSDK_WriteLogW(LPCWSTR szMessage);
  151.  
  152. #ifdef UNICODE
  153. #define BoxedAppSDK_WriteLog BoxedAppSDK_WriteLogW
  154. #else
  155. #define BoxedAppSDK_WriteLog BoxedAppSDK_WriteLogA
  156. #endif // UNICODE
  157.  
  158. // Virtual file system
  159.  
  160. #ifdef UNICODE
  161. #define BoxedAppSDK_CreateVirtualFile BoxedAppSDK_CreateVirtualFileW
  162. #else
  163. #define BoxedAppSDK_CreateVirtualFile BoxedAppSDK_CreateVirtualFileA
  164. #endif // UNICODE
  165.  
  166. // Create new virtual file
  167. HANDLE BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualFileA(
  168. LPCSTR szPath,
  169. DWORD dwDesiredAccess,
  170. DWORD dwShareMode,
  171. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  172. DWORD dwCreationDisposition,
  173. DWORD dwFlagsAndAttributes,
  174. HANDLE hTemplateFile
  175. );
  176.  
  177. HANDLE BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualFileW(
  178. LPCWSTR szPath,
  179. DWORD dwDesiredAccess,
  180. DWORD dwShareMode,
  181. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  182. DWORD dwCreationDisposition,
  183. DWORD dwFlagsAndAttributes,
  184. HANDLE hTemplateFile
  185. );
  186.  
  187.  
  188. #ifdef UNICODE
  189. #define BoxedAppSDK_CreateVirtualDirectory BoxedAppSDK_CreateVirtualDirectoryW
  190. #else
  191. #define BoxedAppSDK_CreateVirtualDirectory BoxedAppSDK_CreateVirtualDirectoryA
  192. #endif // UNICODE
  193.  
  194. // Create new virtual directory
  195. BOOL BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualDirectoryA(
  196. LPCSTR lpPathName,
  197. LPSECURITY_ATTRIBUTES lpSecurityAttributes
  198. );
  199.  
  200. BOOL BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualDirectoryW(
  201. LPCWSTR lpPathName,
  202. LPSECURITY_ATTRIBUTES lpSecurityAttributes
  203. );
  204.  
  205. #ifdef UNICODE
  206. #define BoxedAppSDK_IsVirtualFile BoxedAppSDK_IsVirtualFileW
  207. #else
  208. #define BoxedAppSDK_IsVirtualFile BoxedAppSDK_IsVirtualFileA
  209. #endif // UNICODE
  210.  
  211. // Create new virtual directory
  212. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IsVirtualFileA(
  213. LPCSTR szPath
  214. );
  215.  
  216. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IsVirtualFileW(
  217. LPCWSTR szPath
  218. );
  219.  
  220. // Virtual registry
  221.  
  222. #ifdef UNICODE
  223. #define BoxedAppSDK_CreateVirtualRegKey BoxedAppSDK_CreateVirtualRegKeyW
  224. #else
  225. #define BoxedAppSDK_CreateVirtualRegKey BoxedAppSDK_CreateVirtualRegKeyA
  226. #endif // UNICODE
  227.  
  228. LONG BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualRegKeyA(
  229. HKEY hKey,
  230. LPCSTR lpSubKey,
  231. DWORD Reserved,
  232. LPCSTR lpClass,
  233. DWORD dwOptions,
  234. REGSAM samDesired,
  235. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  236. PHKEY phkResult,
  237. LPDWORD lpdwDisposition
  238. );
  239.  
  240. LONG BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualRegKeyW(
  241. HKEY hKey,
  242. LPCWSTR lpSubKey,
  243. DWORD Reserved,
  244. LPCWSTR lpClass,
  245. DWORD dwOptions,
  246. REGSAM samDesired,
  247. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  248. PHKEY phkResult,
  249. LPDWORD lpdwDisposition
  250. );
  251.  
  252. // Isolation mode for registry keys
  253.  
  254. #ifdef UNICODE
  255. #define BoxedAppSDK_SetRegKeyIsolationMode BoxedAppSDK_SetRegKeyIsolationModeW
  256. #else
  257. #define BoxedAppSDK_SetRegKeyIsolationMode BoxedAppSDK_SetRegKeyIsolationModeA
  258. #endif // UNICODE
  259.  
  260. /// Sets isolation mode for the key
  261. /// To specify registry view use samDesired (pass KEY_WOW64_32KEY or KEY_WOW64_64KEY), pass zero to don't specify registry view
  262. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetRegKeyIsolationModeW(HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired, BX_ISOLATION_MODE IsolationMode);
  263.  
  264. /// Sets isolation mode for the key
  265. /// To specify registry view use samDesired (pass KEY_WOW64_32KEY or KEY_WOW64_64KEY), pass zero to don't specify registry view
  266. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetRegKeyIsolationModeA(HKEY hKey, LPCSTR lpSubKey, REGSAM samDesired, BX_ISOLATION_MODE IsolationMode);
  267.  
  268. #ifdef UNICODE
  269. #define BoxedAppSDK_GetRegKeyIsolationMode BoxedAppSDK_GetRegKeyIsolationModeW
  270. #else
  271. #define BoxedAppSDK_GetRegKeyIsolationMode BoxedAppSDK_GetRegKeyIsolationModeA
  272. #endif // UNICODE
  273.  
  274. /// Gets isolation mode for the key
  275. /// To specify registry view use samDesired (pass KEY_WOW64_32KEY or KEY_WOW64_64KEY), pass zero to don't specify registry view
  276. BX_ISOLATION_MODE BOXEDAPPSDKAPI BoxedAppSDK_GetRegKeyIsolationModeW(HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired);
  277.  
  278. /// Gets isolation mode for the key
  279. /// To specify registry view use samDesired (pass KEY_WOW64_32KEY or KEY_WOW64_64KEY), pass zero to don't specify registry view
  280. BX_ISOLATION_MODE BOXEDAPPSDKAPI BoxedAppSDK_GetRegKeyIsolationModeA(HKEY hKey, LPCSTR lpSubKey, REGSAM samDesired);
  281.  
  282. // Adding virtual registry key from the virtual environment
  283.  
  284. #ifdef UNICODE
  285. #define BoxedAppSDK_AddVirtualRegKey BoxedAppSDK_AddVirtualRegKeyW
  286. #else
  287. #define BoxedAppSDK_AddVirtualRegKey BoxedAppSDK_AddVirtualRegKeyA
  288. #endif // UNICODE
  289.  
  290. LONG BOXEDAPPSDKAPI BoxedAppSDK_AddVirtualRegKeyA(HKEY hKey, LPCSTR lpSubKey);
  291. LONG BOXEDAPPSDKAPI BoxedAppSDK_AddVirtualRegKeyW(HKEY hKey, LPCWSTR lpSubKey);
  292.  
  293. // Removing virtual registry key from the virtual environment
  294.  
  295. #ifdef UNICODE
  296. #define BoxedAppSDK_DeleteVirtualRegKey BoxedAppSDK_DeleteVirtualRegKeyW
  297. #else
  298. #define BoxedAppSDK_DeleteVirtualRegKey BoxedAppSDK_DeleteVirtualRegKeyA
  299. #endif // UNICODE
  300.  
  301. LONG BOXEDAPPSDKAPI BoxedAppSDK_DeleteVirtualRegKeyA(HKEY hKey, LPCSTR lpSubKey);
  302. LONG BOXEDAPPSDKAPI BoxedAppSDK_DeleteVirtualRegKeyW(HKEY hKey, LPCWSTR lpSubKey);
  303.  
  304. LONG BOXEDAPPSDKAPI BoxedAppSDK_DeleteVirtualRegKeyByHandle(HKEY hKey);
  305.  
  306. void BOXEDAPPSDKAPI BoxedAppSDK_SetContext(LPCSTR szContext);
  307.  
  308. HRESULT BOXEDAPPSDKAPI BoxedAppSDK_RegisterCOMLibraryInVirtualRegistryA(LPCSTR szPath);
  309. HRESULT BOXEDAPPSDKAPI BoxedAppSDK_RegisterCOMLibraryInVirtualRegistryW(LPCWSTR szPath);
  310.  
  311. #ifdef UNICODE
  312. #define BoxedAppSDK_RegisterCOMLibraryInVirtualRegistry BoxedAppSDK_RegisterCOMLibraryInVirtualRegistryW
  313. #else
  314. #define BoxedAppSDK_RegisterCOMLibraryInVirtualRegistry BoxedAppSDK_RegisterCOMLibraryInVirtualRegistryA
  315. #endif // UNICODE
  316.  
  317. void BOXEDAPPSDKAPI BoxedAppSDK_EnableOption(DWORD dwOptionIndex, BOOL bEnable);
  318. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IsOptionEnabled(DWORD dwOptionIndex);
  319.  
  320. void BOXEDAPPSDKAPI BoxedAppSDK_RemoteProcess_EnableOption(DWORD dwProcessId, DWORD dwOptionIndex, BOOL bEnable);
  321. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoteProcess_IsOptionEnabled(DWORD dwProcessId, DWORD dwOptionIndex);
  322.  
  323. // Set startup flags
  324. void BOXEDAPPSDKAPI BoxedAppSDK_SetStartupFlags(DWORD dwFlags);
  325.  
  326. typedef enum _ENUM_BOXEDAPPSDK_REQUEST_ID
  327. {
  328. EnumBoxedAppSDK_RequestId__RegQueryValue = 1,
  329. EnumBoxedAppSDK_RequestId__RedirectFilePath = 2
  330. } ENUM_BOXEDAPPSDK_REQUEST_ID;
  331.  
  332. typedef DWORD (BOXEDAPPSDKAPI *PBOXEDAPPHANDLER)(PVOID Param, ENUM_BOXEDAPPSDK_REQUEST_ID RequestId, PVOID pAdditionalInfo);
  333. DWORD BOXEDAPPSDKAPI BoxedAppSDK_AddHandler(PBOXEDAPPHANDLER pHandler, PVOID Param);
  334. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoveHandler(DWORD dwHandlerId);
  335.  
  336. /// A structure that is used for EnumBoxedAppSDK_RequestId__RegQueryValue
  337. struct SBoxedAppSDK__RegQueryValue
  338. {
  339. // in
  340. HKEY m_Root;
  341. LPCWSTR m_szPath;
  342. LPCWSTR m_szValue;
  343.  
  344. // out
  345. BOOL m_bHandled;
  346.  
  347. DWORD m_dwType;
  348. PVOID m_pData;
  349. DWORD m_dwSize;
  350. };
  351.  
  352. PVOID BOXEDAPPSDKAPI BoxedAppSDK_Alloc(DWORD dwSize);
  353. BOOL BOXEDAPPSDKAPI BoxedAppSDK_Free(PVOID pData);
  354.  
  355. DWORD BOXEDAPPSDKAPI BoxedAppSDK_DeleteFileFromVirtualFileSystemW(LPCWSTR szPath);
  356. DWORD BOXEDAPPSDKAPI BoxedAppSDK_DeleteFileFromVirtualFileSystemA(LPCSTR szPath);
  357.  
  358. #ifdef UNICODE
  359. #define BoxedAppSDK_DeleteFileFromVirtualFileSystem BoxedAppSDK_DeleteFileFromVirtualFileSystemW
  360. #else
  361. #define BoxedAppSDK_DeleteFileFromVirtualFileSystem BoxedAppSDK_DeleteFileFromVirtualFileSystemA
  362. #endif // UNICODE
  363.  
  364. BOOL BOXEDAPPSDKAPI BoxedAppSDK_CreateProcessFromMemoryA(
  365. LPCVOID pBuffer,
  366. DWORD dwSize,
  367.  
  368. LPCSTR lpApplicationName,
  369. LPSTR lpCommandLine,
  370. LPSECURITY_ATTRIBUTES lpProcessAttributes,
  371. LPSECURITY_ATTRIBUTES lpThreadAttributes,
  372. BOOL bInheritHandles,
  373. DWORD dwCreationFlags,
  374. LPVOID lpEnvironment,
  375. LPCSTR lpCurrentDirectory,
  376. LPSTARTUPINFOA lpStartupInfo,
  377. LPPROCESS_INFORMATION lpProcessInformation
  378. );
  379.  
  380. BOOL BOXEDAPPSDKAPI BoxedAppSDK_CreateProcessFromMemoryW(
  381. LPCVOID pBuffer,
  382. DWORD dwSize,
  383.  
  384. LPCWSTR lpApplicationName,
  385. LPWSTR lpCommandLine,
  386. LPSECURITY_ATTRIBUTES lpProcessAttributes,
  387. LPSECURITY_ATTRIBUTES lpThreadAttributes,
  388. BOOL bInheritHandles,
  389. DWORD dwCreationFlags,
  390. LPVOID lpEnvironment,
  391. LPCWSTR lpCurrentDirectory,
  392. LPSTARTUPINFOW lpStartupInfo,
  393. LPPROCESS_INFORMATION lpProcessInformation
  394. );
  395.  
  396. #ifdef UNICODE
  397. #define BoxedAppSDK_CreateProcessFromMemory BoxedAppSDK_CreateProcessFromMemoryW
  398. #else
  399. #define BoxedAppSDK_CreateProcessFromMemory BoxedAppSDK_CreateProcessFromMemoryA
  400. #endif // UNICODE
  401.  
  402. // Set param #0
  403. void BOXEDAPPSDKAPI BoxedAppSDK_SetParam0(LPCWSTR param);
  404.  
  405. // Create a virtual file based on IStream
  406. HANDLE BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualFileBasedOnIStreamA(
  407. LPCSTR szPath,
  408. DWORD dwDesiredAccess,
  409. DWORD dwShareMode,
  410. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  411. DWORD dwCreationDisposition,
  412. DWORD dwFlagsAndAttributes,
  413. HANDLE hTemplateFile,
  414.  
  415. LPSTREAM pStream
  416. );
  417.  
  418. HANDLE BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualFileBasedOnIStreamW(
  419. LPCWSTR szPath,
  420. DWORD dwDesiredAccess,
  421. DWORD dwShareMode,
  422. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  423. DWORD dwCreationDisposition,
  424. DWORD dwFlagsAndAttributes,
  425. HANDLE hTemplateFile,
  426.  
  427. LPSTREAM pStream
  428. );
  429.  
  430. #ifdef UNICODE
  431. #define BoxedAppSDK_CreateVirtualFileBasedOnIStream BoxedAppSDK_CreateVirtualFileBasedOnIStreamW
  432. #else
  433. #define BoxedAppSDK_CreateVirtualFileBasedOnIStream BoxedAppSDK_CreateVirtualFileBasedOnIStreamA
  434. #endif // UNICODE
  435.  
  436. HANDLE BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualFileBasedOnBufferA(
  437. LPCSTR szPath,
  438. DWORD dwDesiredAccess,
  439. DWORD dwShareMode,
  440. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  441. DWORD dwCreationDisposition,
  442. DWORD dwFlagsAndAttributes,
  443. HANDLE hTemplateFile,
  444.  
  445. PVOID pData, DWORD dwSize
  446. );
  447.  
  448. HANDLE BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualFileBasedOnBufferW(
  449. LPCWSTR szPath,
  450. DWORD dwDesiredAccess,
  451. DWORD dwShareMode,
  452. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  453. DWORD dwCreationDisposition,
  454. DWORD dwFlagsAndAttributes,
  455. HANDLE hTemplateFile,
  456.  
  457. PVOID pData, DWORD dwSize
  458. );
  459.  
  460. #ifdef UNICODE
  461. #define BoxedAppSDK_CreateVirtualFileBasedOnBuffer BoxedAppSDK_CreateVirtualFileBasedOnBufferW
  462. #else
  463. #define BoxedAppSDK_CreateVirtualFileBasedOnBuffer BoxedAppSDK_CreateVirtualFileBasedOnBufferA
  464. #endif // UNICODE
  465.  
  466. HANDLE BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualFileOnFilePartW(
  467. LPCWSTR szPath,
  468. DWORD dwDesiredAccess,
  469. DWORD dwShareMode,
  470. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  471. DWORD dwCreationDisposition,
  472. DWORD dwFlagsAndAttributes,
  473. HANDLE hTemplateFile,
  474.  
  475. LPCWSTR szSourcePath,
  476. DWORD dwOffsetLow,
  477. DWORD dwOffsetHigh,
  478. DWORD dwSizeLow,
  479. DWORD dwSizeHigh);
  480.  
  481. HANDLE BOXEDAPPSDKAPI BoxedAppSDK_CreateVirtualFileOnFilePartA(
  482. LPCSTR szPath,
  483. DWORD dwDesiredAccess,
  484. DWORD dwShareMode,
  485. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  486. DWORD dwCreationDisposition,
  487. DWORD dwFlagsAndAttributes,
  488. HANDLE hTemplateFile,
  489.  
  490. LPCSTR szSourcePath,
  491. DWORD dwOffsetLow,
  492. DWORD dwOffsetHigh,
  493. DWORD dwSizeLow,
  494. DWORD dwSizeHigh);
  495.  
  496. #ifdef UNICODE
  497. #define BoxedAppSDK_CreateVirtualFileOnFilePart BoxedAppSDK_CreateVirtualFileOnFilePartW
  498. #else
  499. #define BoxedAppSDK_CreateVirtualFileOnFilePart BoxedAppSDK_CreateVirtualFileOnFilePartA
  500. #endif // UNICODE
  501.  
  502. // Get parameter for hooked function
  503. LPVOID BOXEDAPPSDKAPI BoxedAppSDK_GetHookParam();
  504.  
  505. // Attach BoxedApp SDK to another process
  506. BOOL BOXEDAPPSDKAPI BoxedAppSDK_AttachToProcess(HANDLE hProcess);
  507. // Detach BoxedApp SDK from a process
  508. BOOL BOXEDAPPSDKAPI BoxedAppSDK_DetachFromProcess(HANDLE hProcess);
  509. //
  510. BOOL BOXEDAPPSDKAPI BoxedAppSDK_AddStartupDLLW(LPCWSTR szPath);
  511. //
  512. BOOL BOXEDAPPSDKAPI BoxedAppSDK_AddStartupDLLA(LPCSTR szPath);
  513.  
  514. #ifdef UNICODE
  515. #define BoxedAppSDK_AddStartupDLL BoxedAppSDK_AddStartupDLLW
  516. #else
  517. #define BoxedAppSDK_AddStartupDLL BoxedAppSDK_AddStartupDLLA
  518. #endif // UNICODE
  519.  
  520. #ifdef UNICODE
  521. #define BoxedAppSDK_RemoveStartupDLL BoxedAppSDK_RemoveStartupDLLW
  522. #else
  523. #define BoxedAppSDK_RemoveStartupDLL BoxedAppSDK_RemoveStartupDLLA
  524. #endif // UNICODE
  525. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoveStartupDLLW(LPCWSTR szPath);
  526. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoveStartupDLLA(LPCSTR szPath);
  527.  
  528.  
  529. BOOL BOXEDAPPSDKAPI BoxedAppSDK_AddExeToAttachableChildProcExclusionListA(LPCSTR szExeName);
  530.  
  531. BOOL BOXEDAPPSDKAPI BoxedAppSDK_AddExeToAttachableChildProcExclusionListW(LPCWSTR szExeName);
  532.  
  533. #ifdef UNICODE
  534. #define BoxedAppSDK_AddExeToAttachableChildProcExclusionList BoxedAppSDK_AddExeToAttachableChildProcExclusionListW
  535. #else
  536. #define BoxedAppSDK_AddExeToAttachableChildProcExclusionList BoxedAppSDK_AddExeToAttachableChildProcExclusionListA
  537. #endif // UNICODE
  538.  
  539. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoveExeFromAttachableChildProcExclusionListA(LPCSTR szExeName);
  540.  
  541. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoveExeFromAttachableChildProcExclusionListW(LPCWSTR szExeName);
  542.  
  543. #ifdef UNICODE
  544. #define BoxedAppSDK_RemoveExeFromAttachableChildProcExclusionList BoxedAppSDK_RemoveExeFromAttachableChildProcExclusionListW
  545. #else
  546. #define BoxedAppSDK_RemoveExeFromAttachableChildProcExclusionList BoxedAppSDK_RemoveExeFromAttachableChildProcExclusionListA
  547. #endif // UNICODE
  548.  
  549. BOOL BOXEDAPPSDKAPI BoxedAppSDK_AddExeToAttachableChildProcListA(LPCSTR szExeName);
  550.  
  551. BOOL BOXEDAPPSDKAPI BoxedAppSDK_AddExeToAttachableChildProcListW(LPCWSTR szExeName);
  552.  
  553. #ifdef UNICODE
  554. #define BoxedAppSDK_AddExeToAttachableChildProcList BoxedAppSDK_AddExeToAttachableChildProcListW
  555. #else
  556. #define BoxedAppSDK_AddExeToAttachableChildProcList BoxedAppSDK_AddExeToAttachableChildProcListA
  557. #endif // UNICODE
  558.  
  559. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoveExeFromAttachableChildProcListA(LPCSTR szExeName);
  560.  
  561. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoveExeFromAttachableChildProcListW(LPCWSTR szExeName);
  562.  
  563. #ifdef UNICODE
  564. #define BoxedAppSDK_RemoveExeFromAttachableChildProcList BoxedAppSDK_RemoveExeFromAttachableChildProcListW
  565. #else
  566. #define BoxedAppSDK_RemoveExeFromAttachableChildProcList BoxedAppSDK_RemoveExeFromAttachableChildProcListA
  567. #endif // UNICODE
  568.  
  569. // Execute .net application
  570. DWORD BOXEDAPPSDKAPI BoxedAppSDK_ExecuteDotNetApplicationW(LPCWSTR szPath, LPCWSTR szArgs);
  571. DWORD BOXEDAPPSDKAPI BoxedAppSDK_ExecuteDotNetApplicationA(LPCSTR szPath, LPCSTR szArgs);
  572.  
  573. #ifdef UNICODE
  574. #define BoxedAppSDK_ExecuteDotNetApplication BoxedAppSDK_ExecuteDotNetApplicationW
  575. #else
  576. #define BoxedAppSDK_ExecuteDotNetApplication BoxedAppSDK_ExecuteDotNetApplicationA
  577. #endif // UNICODE
  578.  
  579. // Execute .net application, with or without calling AppDomain.Unload()
  580. // AppDomain.Unload() may hang the process for some time
  581. DWORD BOXEDAPPSDKAPI BoxedAppSDK_ExecuteDotNetApplicationExW(LPCWSTR szPath, LPCWSTR szArgs, BOOL bCallAppDomainUnload);
  582. DWORD BOXEDAPPSDKAPI BoxedAppSDK_ExecuteDotNetApplicationExA(LPCSTR szPath, LPCSTR szArgs, BOOL bCallAppDomainUnload);
  583.  
  584. #ifdef UNICODE
  585. #define BoxedAppSDK_ExecuteDotNetApplicationEx BoxedAppSDK_ExecuteDotNetApplicationExW
  586. #else
  587. #define BoxedAppSDK_ExecuteDotNetApplicationEx BoxedAppSDK_ExecuteDotNetApplicationExA
  588. #endif // UNICODE
  589.  
  590. // Internal; don't use
  591. DWORD BOXEDAPPSDKAPI BoxedAppSDK_GetInternalValue(DWORD nValueId, LPVOID buf, DWORD dwSize);
  592.  
  593. // Function hooking
  594. HANDLE BOXEDAPPSDKAPI BoxedAppSDK_HookFunctionWithParam(PVOID pFunction, PVOID pHook, LPVOID pParam, BOOL bEnable);
  595. HANDLE BOXEDAPPSDKAPI BoxedAppSDK_HookFunction(PVOID pFunction, PVOID pHook, BOOL bEnable);
  596. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetHookParam(HANDLE pHook, LPVOID pParam);
  597. PVOID BOXEDAPPSDKAPI BoxedAppSDK_GetOriginalFunction(HANDLE hHook);
  598. BOOL BOXEDAPPSDKAPI BoxedAppSDK_EnableHook(HANDLE hHook, BOOL bEnable);
  599. BOOL BOXEDAPPSDKAPI BoxedAppSDK_UnhookFunction(HANDLE hHook);
  600.  
  601. #ifndef DWORD_PTR
  602. #define DWORD_PTR SIZE_T
  603. #endif // !DWORD_PTR
  604.  
  605. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoteProcess_ReadStringW(DWORD dwProcessId, const VOID* pAddress, LPWSTR* pString);
  606. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoteProcess_ReadStringA(DWORD dwProcessId, const VOID* pAddress, LPSTR* pString);
  607.  
  608. #ifdef UNICODE
  609. #define BoxedAppSDK_RemoteProcess_ReadString BoxedAppSDK_RemoteProcess_ReadStringW
  610. #else
  611. #define BoxedAppSDK_RemoteProcess_ReadString BoxedAppSDK_RemoteProcess_ReadStringA
  612. #endif // UNICODE
  613.  
  614. PVOID BOXEDAPPSDKAPI BoxedAppSDK_RemoteProcess_Alloc(DWORD dwProcessId, DWORD dwSize);
  615. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoteProcess_Free(DWORD dwProcessId, PVOID pMemory);
  616.  
  617. PVOID BOXEDAPPSDKAPI BoxedAppSDK_RemoteProcess_AllocStringW(DWORD dwProcessId, LPCWSTR szSource);
  618. PVOID BOXEDAPPSDKAPI BoxedAppSDK_RemoteProcess_AllocStringA(DWORD dwProcessId, LPCSTR szSource);
  619.  
  620. #ifdef UNICODE
  621. #define BoxedAppSDK_RemoteProcess_AllocString BoxedAppSDK_RemoteProcess_AllocStringW
  622. #else
  623. #define BoxedAppSDK_RemoteProcess_AllocString BoxedAppSDK_RemoteProcess_AllocStringA
  624. #endif // UNICODE
  625.  
  626. HMODULE BOXEDAPPSDKAPI BoxedAppSDK_RemoteProcess_LoadLibraryA(DWORD dwProcessId, LPCSTR szPath);
  627. HMODULE BOXEDAPPSDKAPI BoxedAppSDK_RemoteProcess_LoadLibraryW(DWORD dwProcessId, LPCWSTR szPath);
  628.  
  629. #ifdef UNICODE
  630. #define BoxedAppSDK_RemoteProcess_LoadLibrary BoxedAppSDK_RemoteProcess_LoadLibraryW
  631. #else
  632. #define BoxedAppSDK_RemoteProcess_LoadLibrary BoxedAppSDK_RemoteProcess_LoadLibraryA
  633. #endif // UNICODE
  634.  
  635. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoteProcess_FreeLibrary(DWORD dwProcessId, HMODULE hModule);
  636.  
  637. DWORD BOXEDAPPSDKAPI BoxedAppSDK_RegisterCOMServerInVirtualRegistryA(LPCSTR szCommandLine);
  638. DWORD BOXEDAPPSDKAPI BoxedAppSDK_RegisterCOMServerInVirtualRegistryW(LPCWSTR szCommandLine);
  639.  
  640. #ifdef UNICODE
  641. #define BoxedAppSDK_RegisterCOMServerInVirtualRegistry BoxedAppSDK_RegisterCOMServerInVirtualRegistryW
  642. #else
  643. #define BoxedAppSDK_RegisterCOMServerInVirtualRegistry BoxedAppSDK_RegisterCOMServerInVirtualRegistryA
  644. #endif // UNICODE
  645.  
  646. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IsMainProcess();
  647. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IsVirtualProcessId(DWORD dwProcessId);
  648. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IsAttachedProcessId(DWORD dwProcessId);
  649.  
  650. typedef BOOL (WINAPI *P_BoxedAppSDK_EnumVirtualRegKeysCallbackA)(HKEY hRootKey, LPCSTR szSubKey, LPARAM lParam);
  651. typedef BOOL (WINAPI *P_BoxedAppSDK_EnumVirtualRegKeysCallbackW)(HKEY hRootKey, LPCWSTR szSubKey, LPARAM lParam);
  652.  
  653. BOOL BOXEDAPPSDKAPI BoxedAppSDK_EnumVirtualRegKeysA(P_BoxedAppSDK_EnumVirtualRegKeysCallbackA pEnumFunc, LPARAM lParam);
  654. BOOL BOXEDAPPSDKAPI BoxedAppSDK_EnumVirtualRegKeysW(P_BoxedAppSDK_EnumVirtualRegKeysCallbackW pEnumFunc, LPARAM lParam);
  655.  
  656. #ifdef UNICODE
  657. #define BoxedAppSDK_EnumVirtualRegKeys BoxedAppSDK_EnumVirtualRegKeysW
  658. #define P_BoxedAppSDK_EnumVirtualRegKeysCallback P_BoxedAppSDK_EnumVirtualRegKeysCallbackW
  659. #else
  660. #define BoxedAppSDK_EnumVirtualRegKeys BoxedAppSDK_EnumVirtualRegKeysA
  661. #define P_BoxedAppSDK_EnumVirtualRegKeysCallback P_BoxedAppSDK_EnumVirtualRegKeysCallbackA
  662. #endif // UNICODE
  663.  
  664. #ifndef DEF_BOXEDAPPSDK_INTERFACES_NOT_REQUIRED
  665.  
  666. BOOL BOXEDAPPSDKAPI BoxedAppSDK_CreateCustomVirtualDirectoryA(
  667. LPCSTR lpPathName,
  668. IBxFile* pFile,
  669. LPSECURITY_ATTRIBUTES lpSecurityAttributes);
  670.  
  671. BOOL BOXEDAPPSDKAPI BoxedAppSDK_CreateCustomVirtualDirectoryW(
  672. LPCWSTR lpPathName,
  673. IBxFile* pFile,
  674. LPSECURITY_ATTRIBUTES lpSecurityAttributes);
  675.  
  676. #ifdef UNICODE
  677. #define BoxedAppSDK_CreateCustomVirtualDirectory BoxedAppSDK_CreateCustomVirtualDirectoryW
  678. #else
  679. #define BoxedAppSDK_CreateCustomVirtualDirectory BoxedAppSDK_CreateCustomVirtualDirectoryA
  680. #endif // UNICODE
  681.  
  682. #endif // !DEF_BOXEDAPPSDK_INTERFACES_NOT_REQUIRED
  683.  
  684. /// Retrieves global file isolation mode
  685. BX_ISOLATION_MODE BOXEDAPPSDKAPI BoxedAppSDK_GetGlobalFileIsolationMode();
  686.  
  687. /// Sets global file isolation mode
  688. /// Some file requests (depending on isolation mode) are passed to szDestinationPath
  689. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetGlobalFileIsolationModeA(BX_ISOLATION_MODE IsolationMode, LPCSTR szDestinationPath);
  690.  
  691. /// Sets global file isolation mode
  692. /// Some file requests (depending on isolation mode) are passed to szDestinationPath
  693. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetGlobalFileIsolationModeW(BX_ISOLATION_MODE IsolationMode, LPCWSTR szDestinationPath);
  694.  
  695. #ifdef UNICODE
  696. #define BoxedAppSDK_SetGlobalFileIsolationMode BoxedAppSDK_SetGlobalFileIsolationModeW
  697. #else
  698. #define BoxedAppSDK_SetGlobalFileIsolationMode BoxedAppSDK_SetGlobalFileIsolationModeA
  699. #endif // UNICODE
  700.  
  701. /// Sets isolation mode for directory / file
  702. /// Some file requests (depending on isolation mode) are passed from szRedirectedPath to szDestinationPath
  703. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetFileIsolationModeW(BX_ISOLATION_MODE IsolationMode, LPCWSTR szRedirectedPath, LPCWSTR szDestinationPath);
  704.  
  705. /// Sets isolation mode for directory / file
  706. /// Some file requests (depending on isolation mode) are passed from szRedirectedPath to szDestinationPath
  707. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetFileIsolationModeA(BX_ISOLATION_MODE IsolationMode, LPCSTR szRedirectedPath, LPCSTR szDestinationPath);
  708.  
  709. #ifdef UNICODE
  710. #define BoxedAppSDK_SetFileIsolationMode BoxedAppSDK_SetFileIsolationModeW
  711. #else
  712. #define BoxedAppSDK_SetFileIsolationMode BoxedAppSDK_SetFileIsolationModeA
  713. #endif // UNICODE
  714.  
  715. /// Returns whether the handle virtual
  716. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IsVirtualHandle(HANDLE Handle);
  717.  
  718. // If bxsdk32.dll / bxsdk64.dll can't be loaded, it creates a virtual bxsdk32.dll / bxsdk64.dll,
  719. // all exports points to the correct code
  720. // Useful when you link BoxedAppSDK statically, but some code (another DLL) needs bxsdk32.dll / bxsdk64.dll
  721. // Also see function BoxedAppSDK_SetVirtualBoxedAppSDKDLLBaseDir
  722. void BOXEDAPPSDKAPI BoxedAppSDK_EmulateBoxedAppSDKDLL();
  723.  
  724. // Specifies a base directory where virtual bxsdk32.dll / bxsdk64.dll will be placed
  725. // Actually for each process the virtual bxsdk32.dll / bxsdk64.dll is placed into <base dir>\\proces__int64\\
  726. // Virtual bxsdk32.dll / bxsdk64.dll can be created when BoxedAppSDK_EmulateBoxedAppSDKDLL()
  727. // is called, or when new process is begin attached to virtual environment (you know,
  728. // it's important to have a virtual bxsdk32.dll / bxsdk64.dll if main process uses
  729. // static library of BoxedApp SDK, so real bxsdk32.dll / bxsdk64.dll doesn't exist; but
  730. // attached process should be able to call functions of bxsdk32.dll / bxsdk64.dll -- that's
  731. // the reason)
  732. // It's not required to call this function; boxedapp can use a default value of
  733. // the directory
  734. // Also see function BoxedAppSDK_EmulateBoxedAppSDKDLL
  735. void BOXEDAPPSDKAPI BoxedAppSDK_SetVirtualBoxedAppSDKDLLBaseDirA(LPCSTR szDir);
  736. void BOXEDAPPSDKAPI BoxedAppSDK_SetVirtualBoxedAppSDKDLLBaseDirW(LPCWSTR szDir);
  737.  
  738. #ifdef UNICODE
  739. #define BoxedAppSDK_SetVirtualBoxedAppSDKDLLBaseDir BoxedAppSDK_SetVirtualBoxedAppSDKDLLBaseDirW
  740. #else
  741. #define BoxedAppSDK_SetVirtualBoxedAppSDKDLLBaseDir BoxedAppSDK_SetVirtualBoxedAppSDKDLLBaseDirA
  742. #endif // UNICODE
  743.  
  744. //
  745. // Shared memory API
  746. //
  747.  
  748. typedef LONGLONG BOXEDAPP_SHARED_PTR;
  749.  
  750. BOXEDAPP_SHARED_PTR BOXEDAPPSDKAPI BoxedAppSDK_SharedMem_Alloc(int nSize);
  751. void BOXEDAPPSDKAPI BoxedAppSDK_SharedMem_Free(BOXEDAPP_SHARED_PTR shared_ptr);
  752.  
  753. PVOID BOXEDAPPSDKAPI BoxedAppSDK_SharedMem_Lock(BOXEDAPP_SHARED_PTR shared_ptr);
  754. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SharedMem_Unlock(BOXEDAPP_SHARED_PTR shared_ptr);
  755.  
  756. HRESULT BOXEDAPPSDKAPI BoxedAppSDK_SharedMem_CreateStreamOnSharedMem(LPSTREAM* ppStream);
  757.  
  758. BOOL BOXEDAPPSDKAPI BoxedAppSDK_AddStubCandidateA(LPCSTR szStubPath);
  759. BOOL BOXEDAPPSDKAPI BoxedAppSDK_AddStubCandidateW(LPCWSTR szStubPath);
  760.  
  761. #ifdef UNICODE
  762. #define BoxedAppSDK_AddStubCandidate BoxedAppSDK_AddStubCandidateW
  763. #else
  764. #define BoxedAppSDK_AddStubCandidate BoxedAppSDK_AddStubCandidateA
  765. #endif // UNICODE
  766.  
  767. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoveStubCandidateA(LPCSTR szStubPath);
  768. BOOL BOXEDAPPSDKAPI BoxedAppSDK_RemoveStubCandidateW(LPCWSTR szStubPath);
  769.  
  770. #ifdef UNICODE
  771. #define BoxedAppSDK_RemoveStubCandidate BoxedAppSDK_RemoveStubCandidateW
  772. #else
  773. #define BoxedAppSDK_RemoveStubCandidate BoxedAppSDK_RemoveStubCandidateA
  774. #endif // UNICODE
  775.  
  776. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IsVirtualRegValueW(HKEY hKey, LPCWSTR szValueName);
  777. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IsVirtualRegValueA(HKEY hKey, LPCSTR szValueName);
  778.  
  779. #ifdef UNICODE
  780. #define BoxedAppSDK_IsVirtualRegValue BoxedAppSDK_IsVirtualRegValueW
  781. #else
  782. #define BoxedAppSDK_IsVirtualRegValue BoxedAppSDK_IsVirtualRegValueA
  783. #endif // UNICODE
  784.  
  785. // Virtual installing of assembly
  786. BOOL BoxedAppSDK_InstallAssemblyA(LPCSTR szManifestPath, LPCSTR szPolicyPath);
  787. BOOL BoxedAppSDK_InstallAssemblyW(LPCWSTR szManifestPath, LPCWSTR szPolicyPath);
  788.  
  789. #ifdef UNICODE
  790. #define BoxedAppSDK_InstallAssembly BoxedAppSDK_InstallAssemblyW
  791. #else
  792. #define BoxedAppSDK_InstallAssembly BoxedAppSDK_InstallAssemblyA
  793. #endif // UNICODE
  794.  
  795. // Specify path to bxsdk32.dll / bxsdk64.dll
  796. // It's useful in the following case:
  797. // your application statically linked with BoxedApp SDK, so it doesn't require the DLL to work
  798. // if a process that has another bitness should be attached to the virtual environment, BoxedApp SDK
  799. // will try to use bxsdk32.dll (to attach 32 bit process) or bxsdk64.dll (to attach 64 bit process)
  800. // But your application doesn't need the DLLs. To help BoxedApp SDK you could place
  801. // bxsdk32.dll / bxsdk64.dll somewhere and make BoxedApp SDK uses these paths
  802. // If you just put bxsdk32.dll and bxsdk64.dll to the exe's directory - you don't need to call
  803. // these functions: BoxedApp SDK will find these dlls automatically
  804.  
  805. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetBxSdk32DllPathW(LPCWSTR szPath);
  806. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetBxSdk32DllPathA(LPCSTR szPath);
  807.  
  808. #ifdef UNICODE
  809. #define BoxedAppSDK_SetBxSdk32DllPath BoxedAppSDK_SetBxSdk32DllPathW
  810. #else
  811. #define BoxedAppSDK_SetBxSdk32DllPath BoxedAppSDK_SetBxSdk32DllPathA
  812. #endif // UNICODE
  813.  
  814. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetBxSdk64DllPathW(LPCWSTR szPath);
  815. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetBxSdk64DllPathA(LPCSTR szPath);
  816.  
  817. #ifdef UNICODE
  818. #define BoxedAppSDK_SetBxSdk64DllPath BoxedAppSDK_SetBxSdk64DllPathW
  819. #else
  820. #define BoxedAppSDK_SetBxSdk64DllPath BoxedAppSDK_SetBxSdk64DllPathA
  821. #endif // UNICODE
  822.  
  823. // Specify path to a DLL that redirects call to BoxedApp
  824. // It's useful in the following case:
  825. // your application statically linked with BoxedApp SDK, so it doesn't require the DLL to work
  826. // if a virtual process must be created with CreateProcessWithLogonW, a special helper process
  827. // based on rundll32.exe is started, and rundll32.exe needs a DLL
  828. // Be default, path to boxedapp sdk dll passed, but you can specify your own dll ("shim")
  829. // that will redirect calls to boxedapp sdk code (statically linked into your dll)
  830.  
  831. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetBxSdk32ShimDllPathW(LPCWSTR szPath);
  832. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetBxSdk32ShimDllPathA(LPCSTR szPath);
  833.  
  834. #ifdef UNICODE
  835. #define BoxedAppSDK_SetBxSdk32ShimDllPath BoxedAppSDK_SetBxSdk32ShimDllPathW
  836. #else
  837. #define BoxedAppSDK_SetBxSdk32ShimDllPath BoxedAppSDK_SetBxSdk32ShimDllPathA
  838. #endif // UNICODE
  839.  
  840. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetBxSdk64ShimDllPathW(LPCWSTR szPath);
  841. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetBxSdk64ShimDllPathA(LPCSTR szPath);
  842.  
  843. #ifdef UNICODE
  844. #define BoxedAppSDK_SetBxSdk64ShimDllPath BoxedAppSDK_SetBxSdk64ShimDllPathW
  845. #else
  846. #define BoxedAppSDK_SetBxSdk64ShimDllPath BoxedAppSDK_SetBxSdk64ShimDllPathA
  847. #endif // UNICODE
  848.  
  849. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetVirtualVolumeSerialW(LPCWSTR szPath, DWORD nVolumeSerial);
  850. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetVirtualVolumeSerialA(LPCSTR szPath, DWORD nVolumeSerial);
  851.  
  852. #ifdef UNICODE
  853. #define BoxedAppSDK_SetVirtualVolumeSerial BoxedAppSDK_SetVirtualVolumeSerialW
  854. #else
  855. #define BoxedAppSDK_SetVirtualVolumeSerial BoxedAppSDK_SetVirtualVolumeSerialA
  856. #endif // UNICODE
  857.  
  858. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetVirtualVolumeCreationTimeW(LPCWSTR szPath, FILETIME nVolumeCreationTime);
  859. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetVirtualVolumeCreationTimeA(LPCSTR szPath, FILETIME nVolumeCreationTime);
  860.  
  861. #ifdef UNICODE
  862. #define BoxedAppSDK_SetVirtualVolumeCreationTime BoxedAppSDK_SetVirtualVolumeCreationTimeW
  863. #else
  864. #define BoxedAppSDK_SetVirtualVolumeCreationTime BoxedAppSDK_SetVirtualVolumeCreationTimeA
  865. #endif // UNICODE
  866.  
  867. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetVirtualVolumeNameW(LPCWSTR szPath, LPCWSTR szVolumeName);
  868. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetVirtualVolumeNameA(LPCSTR szPath, LPCSTR szVolumeName);
  869.  
  870. #ifdef UNICODE
  871. #define BoxedAppSDK_SetVirtualVolumeName BoxedAppSDK_SetVirtualVolumeNameW
  872. #else
  873. #define BoxedAppSDK_SetVirtualVolumeName BoxedAppSDK_SetVirtualVolumeNameA
  874. #endif // UNICODE
  875.  
  876. BOOL BOXEDAPPSDKAPI BoxedAppSDK_SetBxSdkRawData(PVOID pData, DWORD dwSize);
  877.  
  878. typedef void (WINAPI* P_BoxedAppSDK_IPC_Listener)(PVOID pRequestData, DWORD dwRequestSize);
  879.  
  880. VOID BOXEDAPPSDKAPI BoxedAppSDK_IPC_AddListenerW(P_BoxedAppSDK_IPC_Listener pListener, LPCWSTR szMessageClass);
  881. VOID BOXEDAPPSDKAPI BoxedAppSDK_IPC_AddListenerA(P_BoxedAppSDK_IPC_Listener pListener, LPCSTR szMessageClass);
  882.  
  883. #ifdef UNICODE
  884. #define BoxedAppSDK_IPC_AddListener BoxedAppSDK_IPC_AddListenerW
  885. #else
  886. #define BoxedAppSDK_IPC_AddListener BoxedAppSDK_IPC_AddListenerA
  887. #endif // UNICODE
  888.  
  889. VOID BOXEDAPPSDKAPI BoxedAppSDK_IPC_RemoveListener(P_BoxedAppSDK_IPC_Listener pListener);
  890.  
  891. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IPC_SendMessageW(LPCWSTR szMessageClass, LPCVOID lpcMessage, DWORD dwMessageSize);
  892. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IPC_SendMessageA(LPCSTR szMessageClass, LPCVOID lpcMessage, DWORD dwMessageSize);
  893.  
  894. #ifdef UNICODE
  895. #define BoxedAppSDK_IPC_SendMessage BoxedAppSDK_IPC_SendMessageW
  896. #else
  897. #define BoxedAppSDK_IPC_SendMessage BoxedAppSDK_IPC_SendMessageA
  898. #endif // UNICODE
  899.  
  900. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IPC_SendMessageToProcessW(DWORD dwPid, LPCWSTR szMessageClass, LPCVOID lpcMessage, DWORD dwMessageSize);
  901. BOOL BOXEDAPPSDKAPI BoxedAppSDK_IPC_SendMessageToProcessA(DWORD dwPid, LPCSTR szMessageClass, LPCVOID lpcMessage, DWORD dwMessageSize);
  902.  
  903. #ifdef UNICODE
  904. #define BoxedAppSDK_IPC_SendMessageToProcess BoxedAppSDK_IPC_SendMessageToProcessW
  905. #else
  906. #define BoxedAppSDK_IPC_SendMessageToProcess BoxedAppSDK_IPC_SendMessageToProcessA
  907. #endif // UNICODE
  908.  
  909. void BOXEDAPPSDKAPI BoxedAppSDK_EnableDebugStatistics(BOOL bEnable, DWORD nThreadId);
  910.  
  911. typedef struct _SBxDebugStatistics
  912. {
  913. ULONGLONG m_nAllocationCount;
  914. } SBxDebugStatistics;
  915.  
  916. BOOL BOXEDAPPSDKAPI BoxedAppSDK_GetDebugStatistics(SBxDebugStatistics* pInfo);
  917.  
  918. #ifdef __cplusplus
  919. }
  920. #endif
  921.  
  922. #include <poppack.h>
  923.  
  924. #endif // !__BOXEDAPPSDK_H__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement