VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxService/VBoxServicePageSharing.cpp@ 29959

Last change on this file since 29959 was 29959, checked in by vboxsync, 15 years ago

More updates for kernel module sharing

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.1 KB
Line 
1/* $Id: VBoxServicePageSharing.cpp 29959 2010-06-01 15:43:19Z vboxsync $ */
2/** @file
3 * VBoxService - Guest page sharing.
4 */
5
6/*
7 * Copyright (C) 2006-2010 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.215389.xyz. 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
18
19/*******************************************************************************
20* Header Files *
21*******************************************************************************/
22#include <iprt/assert.h>
23#include <iprt/avl.h>
24#include <iprt/asm.h>
25#include <iprt/mem.h>
26#include <iprt/stream.h>
27#include <iprt/string.h>
28#include <iprt/semaphore.h>
29#include <iprt/system.h>
30#include <iprt/thread.h>
31#include <iprt/time.h>
32#include <VBox/VBoxGuestLib.h>
33#include "VBoxServiceInternal.h"
34#include "VBoxServiceUtils.h"
35
36
37/*******************************************************************************
38* Global Variables *
39*******************************************************************************/
40
41/** The semaphore we're blocking on. */
42static RTSEMEVENTMULTI g_PageSharingEvent = NIL_RTSEMEVENTMULTI;
43
44#if defined(RT_OS_WINDOWS) && !defined(TARGET_NT4)
45#include <tlhelp32.h>
46#include <psapi.h>
47#include <winternl.h>
48
49typedef struct
50{
51 AVLPVNODECORE Core;
52 HMODULE hModule;
53 char szFileVersion[16];
54 MODULEENTRY32 Info;
55} KNOWN_MODULE, *PKNOWN_MODULE;
56
57#define SystemModuleInformation 11
58
59typedef struct _RTL_PROCESS_MODULE_INFORMATION
60{
61 ULONG Section;
62 PVOID MappedBase;
63 PVOID ImageBase;
64 ULONG ImageSize;
65 ULONG Flags;
66 USHORT LoadOrderIndex;
67 USHORT InitOrderIndex;
68 USHORT LoadCount;
69 USHORT OffsetToFileName;
70 CHAR FullPathName[256];
71} RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;
72
73typedef struct _RTL_PROCESS_MODULES
74{
75 ULONG NumberOfModules;
76 RTL_PROCESS_MODULE_INFORMATION Modules[1];
77} RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;
78
79typedef NTSTATUS (WINAPI *PFNZWQUERYSYSTEMINFORMATION)(ULONG, PVOID, ULONG, PULONG);
80static PFNZWQUERYSYSTEMINFORMATION ZwQuerySystemInformation = NULL;
81static HMODULE hNtdll = 0;
82
83
84static DECLCALLBACK(int) VBoxServicePageSharingEmptyTreeCallback(PAVLPVNODECORE pNode, void *);
85
86static PAVLPVNODECORE pKnownModuleTree = NULL;
87
88/**
89 * Registers a new module with the VMM
90 * @param pModule Module ptr
91 * @param fValidateMemory Validate/touch memory pages or not
92 */
93void VBoxServicePageSharingRegisterModule(PKNOWN_MODULE pModule, bool fValidateMemory)
94{
95 VMMDEVSHAREDREGIONDESC aRegions[VMMDEVSHAREDREGIONDESC_MAX];
96 DWORD dwModuleSize = pModule->Info.modBaseSize;
97 BYTE *pBaseAddress = pModule->Info.modBaseAddr;
98 DWORD cbVersionSize, dummy;
99 BYTE *pVersionInfo;
100
101 VBoxServiceVerbose(3, "VBoxServicePageSharingRegisterModule\n");
102
103 cbVersionSize = GetFileVersionInfoSize(pModule->Info.szExePath, &dummy);
104 if (!cbVersionSize)
105 {
106 VBoxServiceVerbose(3, "VBoxServicePageSharingRegisterModule: GetFileVersionInfoSize failed with %d\n", GetLastError());
107 return;
108 }
109 pVersionInfo = (BYTE *)RTMemAlloc(cbVersionSize);
110 if (!pVersionInfo)
111 return;
112
113 if (!GetFileVersionInfo(pModule->Info.szExePath, 0, cbVersionSize, pVersionInfo))
114 {
115 VBoxServiceVerbose(3, "VBoxServicePageSharingRegisterModule: GetFileVersionInfo failed with %d\n", GetLastError());
116 goto end;
117 }
118
119 /* Fetch default code page. */
120 struct LANGANDCODEPAGE {
121 WORD wLanguage;
122 WORD wCodePage;
123 } *lpTranslate;
124
125 UINT cbTranslate;
126 BOOL ret = VerQueryValue(pVersionInfo, TEXT("\\VarFileInfo\\Translation"), (LPVOID *)&lpTranslate, &cbTranslate);
127 if ( !ret
128 || cbTranslate < 4)
129 {
130 VBoxServiceVerbose(3, "VBoxServicePageSharingRegisterModule: VerQueryValue failed with %d (cb=%d)\n", GetLastError(), cbTranslate);
131 goto end;
132 }
133
134 unsigned i;
135 UINT cbFileVersion;
136 char *lpszFileVersion;
137 unsigned cTranslationBlocks = cbTranslate/sizeof(struct LANGANDCODEPAGE);
138
139 for(i = 0; i < cTranslationBlocks; i++)
140 {
141 /* Fetch file version string. */
142 char szFileVersionLocation[256];
143
144 sprintf(szFileVersionLocation, TEXT("\\StringFileInfo\\%04x%04x\\FileVersion"), lpTranslate[i].wLanguage, lpTranslate[i].wCodePage);
145 ret = VerQueryValue(pVersionInfo, szFileVersionLocation, (LPVOID *)&lpszFileVersion, &cbFileVersion);
146 if (ret)
147 break;
148 }
149 if (i == cTranslationBlocks)
150 {
151 VBoxServiceVerbose(3, "VBoxServicePageSharingRegisterModule: no file version found!\n");
152 goto end;
153 }
154
155 _snprintf(pModule->szFileVersion, sizeof(pModule->szFileVersion), "%s", lpszFileVersion);
156 pModule->szFileVersion[RT_ELEMENTS(pModule->szFileVersion) - 1] = 0;
157
158 unsigned idxRegion = 0;
159
160 if (fValidateMemory)
161 {
162 do
163 {
164 MEMORY_BASIC_INFORMATION MemInfo;
165
166 SIZE_T ret = VirtualQuery(pBaseAddress, &MemInfo, sizeof(MemInfo));
167 Assert(ret);
168 if (!ret)
169 {
170 VBoxServiceVerbose(3, "VBoxServicePageSharingRegisterModule: VirtualQueryEx failed with %d\n", GetLastError());
171 break;
172 }
173
174 if ( MemInfo.State == MEM_COMMIT
175 && MemInfo.Type == MEM_IMAGE)
176 {
177 switch (MemInfo.Protect)
178 {
179 case PAGE_EXECUTE:
180 case PAGE_EXECUTE_READ:
181 case PAGE_READONLY:
182 {
183 char *pRegion = (char *)MemInfo.BaseAddress;
184
185 /* Skip the first region as it only contains the image file header. */
186 if (pRegion != (char *)pModule->Info.modBaseAddr)
187 {
188 /* Touch all pages. */
189 while (pRegion < (char *)MemInfo.BaseAddress + MemInfo.RegionSize)
190 {
191 /* Try to trick the optimizer to leave the page touching code in place. */
192 ASMProbeReadByte(pRegion);
193 pRegion += PAGE_SIZE;
194 }
195 }
196 aRegions[idxRegion].GCRegionAddr = (RTGCPTR64)MemInfo.BaseAddress;
197 aRegions[idxRegion].cbRegion = MemInfo.RegionSize;
198 idxRegion++;
199
200 break;
201 }
202
203 default:
204 break; /* ignore */
205 }
206 }
207
208 pBaseAddress = (BYTE *)MemInfo.BaseAddress + MemInfo.RegionSize;
209 if (dwModuleSize > MemInfo.RegionSize)
210 {
211 dwModuleSize -= MemInfo.RegionSize;
212 }
213 else
214 {
215 dwModuleSize = 0;
216 break;
217 }
218
219 if (idxRegion >= RT_ELEMENTS(aRegions))
220 break; /* out of room */
221 }
222 while (dwModuleSize);
223 }
224 else
225 {
226 /* We can't probe kernel memory ranges, so pretend it's one big region. */
227 aRegions[idxRegion].GCRegionAddr = (RTGCPTR64)pBaseAddress;
228 aRegions[idxRegion].cbRegion = dwModuleSize;
229 idxRegion++;
230 }
231 VBoxServiceVerbose(3, "VbglR3RegisterSharedModule %s %s base=%p size=%x cregions=%d\n", pModule->Info.szModule, pModule->szFileVersion, pModule->Info.modBaseAddr, pModule->Info.modBaseSize, idxRegion);
232 int rc = VbglR3RegisterSharedModule(pModule->Info.szModule, pModule->szFileVersion, (RTGCPTR64)pModule->Info.modBaseAddr,
233 pModule->Info.modBaseSize, idxRegion, aRegions);
234// AssertRC(rc);
235 if (RT_FAILURE(rc))
236 VBoxServiceVerbose(3, "VbglR3RegisterSharedModule failed with %d\n", rc);
237
238end:
239 RTMemFree(pVersionInfo);
240 return;
241}
242
243/**
244 * Inspect all loaded modules for the specified process
245 * @param dwProcessId Process id
246 */
247void VBoxServicePageSharingInspectModules(DWORD dwProcessId, PAVLPVNODECORE *ppNewTree)
248{
249 HANDLE hProcess, hSnapshot;
250
251 /* Get a list of all the modules in this process. */
252 hProcess = OpenProcess(PROCESS_QUERY_INFORMATION,
253 FALSE /* no child process handle inheritance */, dwProcessId);
254 if (hProcess == NULL)
255 {
256 VBoxServiceVerbose(3, "VBoxServicePageSharingInspectModules: OpenProcess %x failed with %d\n", dwProcessId, GetLastError());
257 return;
258 }
259
260 hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessId);
261 if (hSnapshot == INVALID_HANDLE_VALUE)
262 {
263 VBoxServiceVerbose(3, "VBoxServicePageSharingInspectModules: CreateToolhelp32Snapshot failed with %d\n", GetLastError());
264 CloseHandle(hProcess);
265 return;
266 }
267
268 VBoxServiceVerbose(3, "VBoxServicePageSharingInspectModules\n");
269
270 MODULEENTRY32 ModuleInfo;
271 BOOL bRet;
272
273 ModuleInfo.dwSize = sizeof(ModuleInfo);
274 bRet = Module32First(hSnapshot, &ModuleInfo);
275 do
276 {
277 /** todo when changing this make sure VBoxService.exe is excluded! */
278 char *pszDot = strrchr(ModuleInfo.szModule, '.');
279 if ( pszDot
280 && (pszDot[1] == 'e' || pszDot[1] == 'E'))
281 continue; /* ignore executables for now. */
282
283 /* Found it before? */
284 PAVLPVNODECORE pRec = RTAvlPVGet(ppNewTree, ModuleInfo.modBaseAddr);
285 if (!pRec)
286 {
287 pRec = RTAvlPVRemove(&pKnownModuleTree, ModuleInfo.modBaseAddr);
288 if (!pRec)
289 {
290 /* New module; register it. */
291 PKNOWN_MODULE pModule = (PKNOWN_MODULE)RTMemAllocZ(sizeof(*pModule));
292 Assert(pModule);
293 if (!pModule)
294 break;
295
296 pModule->Info = ModuleInfo;
297 pModule->Core.Key = ModuleInfo.modBaseAddr;
298 pModule->hModule = LoadLibraryEx(ModuleInfo.szExePath, 0, DONT_RESOLVE_DLL_REFERENCES);
299 if (pModule->hModule)
300 VBoxServicePageSharingRegisterModule(pModule, true /* validate pages */);
301
302 VBoxServiceVerbose(3, "\n\n MODULE NAME: %s", ModuleInfo.szModule );
303 VBoxServiceVerbose(3, "\n executable = %s", ModuleInfo.szExePath );
304 VBoxServiceVerbose(3, "\n process ID = 0x%08X", ModuleInfo.th32ProcessID );
305 VBoxServiceVerbose(3, "\n base address = 0x%08X", (DWORD) ModuleInfo.modBaseAddr );
306 VBoxServiceVerbose(3, "\n base size = %d", ModuleInfo.modBaseSize );
307
308 pRec = &pModule->Core;
309 }
310 bool ret = RTAvlPVInsert(ppNewTree, pRec);
311 Assert(ret); NOREF(ret);
312 }
313 }
314 while (Module32Next(hSnapshot, &ModuleInfo));
315
316 CloseHandle(hSnapshot);
317 CloseHandle(hProcess);
318}
319
320/**
321 * Inspect all running processes for executables and dlls that might be worth sharing
322 * with other VMs.
323 *
324 */
325void VBoxServicePageSharingInspectGuest()
326{
327 HANDLE hSnapshot;
328 PAVLPVNODECORE pNewTree = NULL;
329 DWORD dwProcessId = GetCurrentProcessId();
330
331 VBoxServiceVerbose(3, "VBoxServicePageSharingInspectGuest\n");
332
333 hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
334 if (hSnapshot == INVALID_HANDLE_VALUE)
335 {
336 VBoxServiceVerbose(3, "CreateToolhelp32Snapshot failed with %d\n", GetLastError());
337 return;
338 }
339
340 /* Check loaded modules for all running processes. */
341 PROCESSENTRY32 ProcessInfo;
342
343 ProcessInfo.dwSize = sizeof(ProcessInfo);
344 Process32First(hSnapshot, &ProcessInfo);
345
346 do
347 {
348 /* Skip our own process. */
349 if (ProcessInfo.th32ProcessID != dwProcessId)
350 VBoxServicePageSharingInspectModules(ProcessInfo.th32ProcessID, &pNewTree);
351 }
352 while (Process32Next(hSnapshot, &ProcessInfo));
353
354 CloseHandle(hSnapshot);
355
356#if 0
357 /* Check all loaded kernel modules. */
358 if (ZwQuerySystemInformation)
359 {
360 ULONG cbBuffer = 0;
361 PVOID pBuffer = NULL;
362 PRTL_PROCESS_MODULES pSystemModules;
363
364 NTSTATUS ret = ZwQuerySystemInformation(SystemModuleInformation, (PVOID)&cbBuffer, 0, &cbBuffer);
365 if (!cbBuffer)
366 {
367 VBoxServiceVerbose(1, "ZwQuerySystemInformation returned length 0\n");
368 goto skipkernelmodules;
369 }
370
371 pBuffer = RTMemAllocZ(cbBuffer);
372 if (!pBuffer)
373 goto skipkernelmodules;
374
375 ret = ZwQuerySystemInformation(SystemModuleInformation, pBuffer, cbBuffer, &cbBuffer);
376 if (ret != STATUS_SUCCESS)
377 {
378 VBoxServiceVerbose(1, "ZwQuerySystemInformation returned %x (1)\n", ret);
379 goto skipkernelmodules;
380 }
381
382 pSystemModules = (PRTL_PROCESS_MODULES)pBuffer;
383 for (unsigned i = 0; i < pSystemModules->NumberOfModules; i++)
384 {
385 /* User-mode modules seem to have no flags set; skip them as we detected them above. */
386 if (pSystemModules->Modules[i].flags == 0)
387 continue;
388
389 char *pszDot = strrchr(pSystemModules->Modules[i].FullPathName, '.');
390 if ( pszDot
391 && (pszDot[1] == 'e' || pszDot[1] == 'E'))
392 continue; /* ignore executables for now. */
393
394 /* Found it before? */
395 PAVLPVNODECORE pRec = RTAvlPVGet(&pNewTree, pSystemModules->Modules[i].ImageBase);
396 if (!pRec)
397 {
398 pRec = RTAvlPVRemove(&pKnownModuleTree, pSystemModules->Modules[i].ImageBase);
399 if (!pRec)
400 {
401 /* New module; register it. */
402 char szFullFilePath[512];
403 PKNOWN_MODULE pModule = (PKNOWN_MODULE)RTMemAllocZ(sizeof(*pModule));
404 Assert(pModule);
405 if (!pModule)
406 break;
407
408 strcpy(pModule->Info.szModule, &pSystemModules->Modules[i].FullPathName[pSystemModules->Modules[i].OffsetToFileName]);
409 GetSystemDirectoryA(szFullFilePath, sizeof(szFullFilePath));
410
411 /* skip \Systemroot\system32 */
412 char *lpPath = strchr(&pSystemModules->Modules[i].FullPathName[1], '\\');
413 if (!lpPath)
414 {
415 VBoxServiceVerbose(1, "Unexpected kernel module name %s\n", pSystemModules->Modules[i].FullPathName);
416 RTMemFree(pModule);
417 break;
418 }
419
420 lpPath = strchr(lpPath+1, '\\');
421 if (!lpPath)
422 {
423 VBoxServiceVerbose(1, "Unexpected kernel module name %s\n", pSystemModules->Modules[i].FullPathName);
424 RTMemFree(pModule);
425 break;
426 }
427
428 strcat(szFullFilePath, lpPath);
429 strcpy(pModule->Info.szExePath, szFullFilePath);
430 pModule->Info.modBaseAddr = (BYTE *)pSystemModules->Modules[i].ImageBase;
431 pModule->Info.modBaseSize = pSystemModules->Modules[i].ImageSize;
432
433 pModule->Core.Key = pSystemModules->Modules[i].ImageBase;
434 VBoxServicePageSharingRegisterModule(pModule, false /* don't check memory pages */);
435
436 VBoxServiceVerbose(3, "\n\n KERNEL MODULE NAME: %s", pModule->Info.szModule );
437 VBoxServiceVerbose(3, "\n executable = %s", pModule->Info.szExePath );
438 VBoxServiceVerbose(3, "\n base address = 0x%08X", (DWORD) pModule->Info.modBaseAddr );
439 VBoxServiceVerbose(3, "\n flags = 0x%08X", pSystemModules->Modules[i].flags);
440 VBoxServiceVerbose(3, "\n base size = %d", pModule->Info.modBaseSize );
441
442 pRec = &pModule->Core;
443 }
444 bool ret = RTAvlPVInsert(&pNewTree, pRec);
445 Assert(ret); NOREF(ret);
446 }
447 }
448skipkernelmodules:
449 if (pBuffer)
450 RTMemFree(pBuffer);
451 }
452#endif
453
454 /* Delete leftover modules in the old tree. */
455 RTAvlPVDestroy(&pKnownModuleTree, VBoxServicePageSharingEmptyTreeCallback, NULL);
456
457 /* Check all registered modules. */
458 VbglR3CheckSharedModules();
459
460 /* Activate new module tree. */
461 pKnownModuleTree = pNewTree;
462}
463
464/**
465 * RTAvlPVDestroy callback.
466 */
467static DECLCALLBACK(int) VBoxServicePageSharingEmptyTreeCallback(PAVLPVNODECORE pNode, void *)
468{
469 PKNOWN_MODULE pModule = (PKNOWN_MODULE)pNode;
470
471 VBoxServiceVerbose(3, "VBoxServicePageSharingEmptyTreeCallback %s %s\n", pModule->Info.szModule, pModule->szFileVersion);
472
473 /* Defererence module in the hypervisor. */
474 int rc = VbglR3UnregisterSharedModule(pModule->Info.szModule, pModule->szFileVersion, (RTGCPTR64)pModule->Info.modBaseAddr, pModule->Info.modBaseSize);
475 AssertRC(rc);
476
477 if (pModule->hModule)
478 FreeLibrary(pModule->hModule);
479 RTMemFree(pNode);
480 return 0;
481}
482
483
484#elif TARGET_NT4
485void VBoxServicePageSharingInspectGuest()
486{
487 /* not implemented */
488}
489#else
490void VBoxServicePageSharingInspectGuest()
491{
492 /* @todo other platforms */
493}
494#endif
495
496/** @copydoc VBOXSERVICE::pfnPreInit */
497static DECLCALLBACK(int) VBoxServicePageSharingPreInit(void)
498{
499 return VINF_SUCCESS;
500}
501
502
503/** @copydoc VBOXSERVICE::pfnOption */
504static DECLCALLBACK(int) VBoxServicePageSharingOption(const char **ppszShort, int argc, char **argv, int *pi)
505{
506 NOREF(ppszShort);
507 NOREF(argc);
508 NOREF(argv);
509 NOREF(pi);
510 return VINF_SUCCESS;
511}
512
513
514/** @copydoc VBOXSERVICE::pfnInit */
515static DECLCALLBACK(int) VBoxServicePageSharingInit(void)
516{
517 VBoxServiceVerbose(3, "VBoxServicePageSharingInit\n");
518
519 int rc = RTSemEventMultiCreate(&g_PageSharingEvent);
520 AssertRCReturn(rc, rc);
521
522#if defined(RT_OS_WINDOWS) && !defined(TARGET_NT4)
523 hNtdll = LoadLibrary("ntdll.dll");
524
525 if (hNtdll)
526 ZwQuerySystemInformation = (PFNZWQUERYSYSTEMINFORMATION)GetProcAddress(hNtdll, "ZwQuerySystemInformation");
527#endif
528
529 /* @todo report system name and version */
530 /* Never fail here. */
531 return VINF_SUCCESS;
532}
533
534/** @copydoc VBOXSERVICE::pfnWorker */
535DECLCALLBACK(int) VBoxServicePageSharingWorker(bool volatile *pfShutdown)
536{
537 /*
538 * Tell the control thread that it can continue
539 * spawning services.
540 */
541 RTThreadUserSignal(RTThreadSelf());
542
543 /*
544 * Block here first for a minute as using DONT_RESOLVE_DLL_REFERENCES is kind of risky; other code that uses LoadLibrary on a dll loaded like this
545 * before will end up crashing the process as the dll's init routine was never called.
546 *
547 * We have to use this feature as we can't simply execute all init code in our service process.
548 *
549 */
550 int rc = RTSemEventMultiWait(g_PageSharingEvent, 60000);
551 if (*pfShutdown)
552 goto end;
553
554 if (rc != VERR_TIMEOUT && RT_FAILURE(rc))
555 {
556 VBoxServiceError("RTSemEventMultiWait failed; rc=%Rrc\n", rc);
557 goto end;
558 }
559
560 /*
561 * Now enter the loop retrieving runtime data continuously.
562 */
563 for (;;)
564 {
565 VBoxServiceVerbose(3, "VBoxServicePageSharingWorker: enabled=%d\n", VbglR3PageSharingIsEnabled());
566
567 if (VbglR3PageSharingIsEnabled())
568 VBoxServicePageSharingInspectGuest();
569
570 /*
571 * Block for a minute.
572 *
573 * The event semaphore takes care of ignoring interruptions and it
574 * allows us to implement service wakeup later.
575 */
576 if (*pfShutdown)
577 break;
578 rc = RTSemEventMultiWait(g_PageSharingEvent, 60000);
579 if (*pfShutdown)
580 break;
581 if (rc != VERR_TIMEOUT && RT_FAILURE(rc))
582 {
583 VBoxServiceError("RTSemEventMultiWait failed; rc=%Rrc\n", rc);
584 break;
585 }
586 }
587
588end:
589 RTSemEventMultiDestroy(g_PageSharingEvent);
590 g_PageSharingEvent = NIL_RTSEMEVENTMULTI;
591
592 VBoxServiceVerbose(3, "VBoxServicePageSharingWorker: finished thread\n");
593 return 0;
594}
595
596/** @copydoc VBOXSERVICE::pfnTerm */
597static DECLCALLBACK(void) VBoxServicePageSharingTerm(void)
598{
599 VBoxServiceVerbose(3, "VBoxServicePageSharingTerm\n");
600
601#if defined(RT_OS_WINDOWS) && !defined(TARGET_NT4)
602 if (hNtdll)
603 FreeLibrary(hNtdll);
604#endif
605 return;
606}
607
608
609/** @copydoc VBOXSERVICE::pfnStop */
610static DECLCALLBACK(void) VBoxServicePageSharingStop(void)
611{
612 RTSemEventMultiSignal(g_PageSharingEvent);
613}
614
615
616/**
617 * The 'pagesharing' service description.
618 */
619VBOXSERVICE g_PageSharing =
620{
621 /* pszName. */
622 "pagesharing",
623 /* pszDescription. */
624 "Page Sharing",
625 /* pszUsage. */
626 NULL,
627 /* pszOptions. */
628 NULL,
629 /* methods */
630 VBoxServicePageSharingPreInit,
631 VBoxServicePageSharingOption,
632 VBoxServicePageSharingInit,
633 VBoxServicePageSharingWorker,
634 VBoxServicePageSharingStop,
635 VBoxServicePageSharingTerm
636};
Note: See TracBrowser for help on using the repository browser.

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