aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/pipe.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/pipe.h')
-rw-r--r--src/burn/engine/pipe.h113
1 files changed, 113 insertions, 0 deletions
diff --git a/src/burn/engine/pipe.h b/src/burn/engine/pipe.h
new file mode 100644
index 00000000..429cd824
--- /dev/null
+++ b/src/burn/engine/pipe.h
@@ -0,0 +1,113 @@
1#pragma once
2// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
3
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9typedef struct _BURN_PIPE_CONNECTION
10{
11 LPWSTR sczName;
12 LPWSTR sczSecret;
13 DWORD dwProcessId;
14
15 HANDLE hProcess;
16 HANDLE hPipe;
17 HANDLE hCachePipe;
18} BURN_PIPE_CONNECTION;
19
20typedef enum _BURN_PIPE_MESSAGE_TYPE : DWORD
21{
22 BURN_PIPE_MESSAGE_TYPE_LOG = 0xF0000001,
23 BURN_PIPE_MESSAGE_TYPE_COMPLETE = 0xF0000002,
24 BURN_PIPE_MESSAGE_TYPE_TERMINATE = 0xF0000003,
25} BURN_PIPE_MESSAGE_TYPE;
26
27typedef struct _BURN_PIPE_MESSAGE
28{
29 DWORD dwMessage;
30 SIZE_T cbData;
31
32 BOOL fAllocatedData;
33 LPVOID pvData;
34} BURN_PIPE_MESSAGE;
35
36typedef struct _BURN_PIPE_RESULT
37{
38 DWORD dwResult;
39 BOOL fRestart;
40} BURN_PIPE_RESULT;
41
42
43typedef HRESULT (*PFN_PIPE_MESSAGE_CALLBACK)(
44 __in BURN_PIPE_MESSAGE* pMsg,
45 __in_opt LPVOID pvContext,
46 __out DWORD* pdwResult
47 );
48
49
50// Common functions.
51void PipeConnectionInitialize(
52 __in BURN_PIPE_CONNECTION* pConnection
53 );
54void PipeConnectionUninitialize(
55 __in BURN_PIPE_CONNECTION* pConnection
56 );
57HRESULT PipeSendMessage(
58 __in HANDLE hPipe,
59 __in DWORD dwMessage,
60 __in_bcount_opt(cbData) LPVOID pvData,
61 __in SIZE_T cbData,
62 __in_opt PFN_PIPE_MESSAGE_CALLBACK pfnCallback,
63 __in_opt LPVOID pvContext,
64 __out DWORD* pdwResult
65 );
66HRESULT PipePumpMessages(
67 __in HANDLE hPipe,
68 __in_opt PFN_PIPE_MESSAGE_CALLBACK pfnCallback,
69 __in_opt LPVOID pvContext,
70 __in BURN_PIPE_RESULT* pResult
71 );
72
73// Parent functions.
74HRESULT PipeCreateNameAndSecret(
75 __out_z LPWSTR *psczConnectionName,
76 __out_z LPWSTR *psczSecret
77 );
78HRESULT PipeCreatePipes(
79 __in BURN_PIPE_CONNECTION* pConnection,
80 __in BOOL fCreateCachePipe,
81 __out HANDLE* phEvent
82 );
83HRESULT PipeLaunchParentProcess(
84 __in LPCWSTR wzCommandLine,
85 __in int nCmdShow,
86 __in_z LPWSTR sczConnectionName,
87 __in_z LPWSTR sczSecret,
88 __in BOOL fDisableUnelevate
89 );
90HRESULT PipeLaunchChildProcess(
91 __in_z LPCWSTR wzExecutablePath,
92 __in BURN_PIPE_CONNECTION* pConnection,
93 __in BOOL fElevate,
94 __in_opt HWND hwndParent
95 );
96HRESULT PipeWaitForChildConnect(
97 __in BURN_PIPE_CONNECTION* pConnection
98 );
99HRESULT PipeTerminateChildProcess(
100 __in BURN_PIPE_CONNECTION* pConnection,
101 __in DWORD dwParentExitCode,
102 __in BOOL fRestart
103 );
104
105// Child functions.
106HRESULT PipeChildConnect(
107 __in BURN_PIPE_CONNECTION* pConnection,
108 __in BOOL fConnectCachePipe
109 );
110
111#ifdef __cplusplus
112}
113#endif