VirtualBox

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

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

Enabled 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 29961 2010-06-01 15:49:18Z 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 /* Check all loaded kernel modules. */
357 if (ZwQuerySystemInformation)
358 {
359 ULONG cbBuffer = 0;
360 PVOID pBuffer = NULL;
361 PRTL_PROCESS_MODULES pSystemModules;
362
363 NTSTATUS ret = ZwQuerySystemInformation(SystemModuleInformation, (PVOID)&cbBuffer, 0, &cbBuffer);
364 if (!cbBuffer)
365 {
366 VBoxServiceVerbose(1, "ZwQuerySystemInformation returned length 0\n");
367 goto skipkernelmodules;
368 }
369
370 pBuffer = RTMemAllocZ(cbBuffer);
371 if (!pBuffer)
372 goto skipkernelmodules;
373
374 ret = ZwQuerySystemInformation(SystemModuleInformation, pBuffer, cbBuffer, &cbBuffer);
375 if (ret != STATUS_SUCCESS)
376 {
377 VBoxServiceVerbose(1, "ZwQuerySystemInformation returned %x (1)\n", ret);
378 goto skipkernelmodules;
379 }
380
381 pSystemModules = (PRTL_PROCESS_MODULES)pBuffer;
382 for (unsigned i = 0; i < pSystemModules->NumberOfModules; i++)
383 {
384 /* User-mode modules seem to have no flags set; skip them as we detected them above. */
385 if (pSystemModules->Modules[i].flags == 0)
386 continue;
387
388 char *pszDot = strrchr(pSystemModules->Modules[i].FullPathName, '.');
389 if ( pszDot
390 && (pszDot[1] == 'e' || pszDot[1] == 'E'))
391 continue; /* ignore executables for now. */
392
393 /* Found it before? */
394 PAVLPVNODECORE pRec = RTAvlPVGet(&pNewTree, pSystemModules->Modules[i].ImageBase);
395 if (!pRec)
396 {
397 pRec = RTAvlPVRemove(&pKnownModuleTree, pSystemModules->Modules[i].ImageBase);
398 if (!pRec)
399 {
400 /* New module; register it. */
401 char szFullFilePath[512];
402 PKNOWN_MODULE pModule = (PKNOWN_MODULE)RTMemAllocZ(sizeof(*pModule));
403 Assert(pModule);
404 if (!pModule)
405 break;
406
407 strcpy(pModule->Info.szModule, &pSystemModules->Modules[i].FullPathName[pSystemModules->Modules[i].OffsetToFileName]);
408 GetSystemDirectoryA(szFullFilePath, sizeof(szFullFilePath));
409
410 /* skip \Systemroot\system32 */
411 char *lpPath = strchr(&pSystemModules->Modules[i].FullPathName[1], '\\');
412 if (!lpPath)
413 {
414 VBoxServiceVerbose(1, "Unexpected kernel module name %s\n", pSystemModules->Modules[i].FullPathName);
415 RTMemFree(pModule);
416 break;
417 }
418
419 lpPath = strchr(lpPath+1, '\\');
420 if (!lpPath)
421 {
422 VBoxServiceVerbose(1, "Unexpected kernel module name %s\n", pSystemModules->Modules[i].FullPathName);
423 RTMemFree(pModule);
424 break;
425 }
426
427 strcat(szFullFilePath, lpPath);
428 strcpy(pModule->Info.szExePath, szFullFilePath);
429 pModule->Info.modBaseAddr = (BYTE *)pSystemModules->Modules[i].ImageBase;
430 pModule->Info.modBaseSize = pSystemModules->Modules[i].ImageSize;
431
432 pModule->Core.Key = pSystemModules->Modules[i].ImageBase;
433 VBoxServicePageSharingRegisterModule(pModule, false /* don't check memory pages */);
434
435 VBoxServiceVerbose(3, "\n\n KERNEL MODULE NAME: %s", pModule->Info.szModule );
436 VBoxServiceVerbose(3, "\n executable = %s", pModule->Info.szExePath );
437 VBoxServiceVerbose(3, "\n base address = 0x%08X", (DWORD) pModule->Info.modBaseAddr );
438 VBoxServiceVerbose(3, "\n flags = 0x%08X", pSystemModules->Modules[i].flags);
439 VBoxServiceVerbose(3, "\n base size = %d", pModule->Info.modBaseSize );
440
441 pRec = &pModule->Core;
442 }
443 bool ret = RTAvlPVInsert(&pNewTree, pRec);
444 Assert(ret); NOREF(ret);
445 }
446 }
447skipkernelmodules:
448 if (pBuffer)
449 RTMemFree(pBuffer);
450 }
451
452 /* Delete leftover modules in the old tree. */
453 RTAvlPVDestroy(&pKnownModuleTree, VBoxServicePageSharingEmptyTreeCallback, NULL);
454
455 /* Check all registered modules. */
456 VbglR3CheckSharedModules();
457
458 /* Activate new module tree. */
459 pKnownModuleTree = pNewTree;
460}
461
462/**
463 * RTAvlPVDestroy callback.
464 */
465static DECLCALLBACK(int) VBoxServicePageSharingEmptyTreeCallback(PAVLPVNODECORE pNode, void *)
466{
467 PKNOWN_MODULE pModule = (PKNOWN_MODULE)pNode;
468
469 VBoxServiceVerbose(3, "VBoxServicePageSharingEmptyTreeCallback %s %s\n", pModule->Info.szModule, pModule->szFileVersion);
470
471 /* Defererence module in the hypervisor. */
472 int rc = VbglR3UnregisterSharedModule(pModule->Info.szModule, pModule->szFileVersion, (RTGCPTR64)pModule->Info.modBaseAddr, pModule->Info.modBaseSize);
473 AssertRC(rc);
474
475 if (pModule->hModule)
476 FreeLibrary(pModule->hModule);
477 RTMemFree(pNode);
478 return 0;
479}
480
481
482#elif TARGET_NT4
483void VBoxServicePageSharingInspectGuest()
484{
485 /* not implemented */
486}
487#else
488void VBoxServicePageSharingInspectGuest()
489{
490 /* @todo other platforms */
491}
492#endif
493
494/** @copydoc VBOXSERVICE::pfnPreInit */
495static DECLCALLBACK(int) VBoxServicePageSharingPreInit(void)
496{
497 return VINF_SUCCESS;
498}
499
500
501/** @copydoc VBOXSERVICE::pfnOption */
502static DECLCALLBACK(int) VBoxServicePageSharingOption(const char **ppszShort, int argc, char **argv, int *pi)
503{
504 NOREF(ppszShort);
505 NOREF(argc);
506 NOREF(argv);
507 NOREF(pi);
508 return VINF_SUCCESS;
509}
510
511
512/** @copydoc VBOXSERVICE::pfnInit */
513static DECLCALLBACK(int) VBoxServicePageSharingInit(void)
514{
515 VBoxServiceVerbose(3, "VBoxServicePageSharingInit\n");
516
517 int rc = RTSemEventMultiCreate(&g_PageSharingEvent);
518 AssertRCReturn(rc, rc);
519
520#if defined(RT_OS_WINDOWS) && !defined(TARGET_NT4)
521 hNtdll = LoadLibrary("ntdll.dll");
522
523 if (hNtdll)
524 ZwQuerySystemInformation = (PFNZWQUERYSYSTEMINFORMATION)GetProcAddress(hNtdll, "ZwQuerySystemInformation");
525#endif
526
527 /* @todo report system name and version */
528 /* Never fail here. */
529 return VINF_SUCCESS;
530}
531
532/** @copydoc VBOXSERVICE::pfnWorker */
533DECLCALLBACK(int) VBoxServicePageSharingWorker(bool volatile *pfShutdown)
534{
535 /*
536 * Tell the control thread that it can continue
537 * spawning services.
538 */
539 RTThreadUserSignal(RTThreadSelf());
540
541 /*
542 * 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
543 * before will end up crashing the process as the dll's init routine was never called.
544 *
545 * We have to use this feature as we can't simply execute all init code in our service process.
546 *
547 */
548 int rc = RTSemEventMultiWait(g_PageSharingEvent, 60000);
549 if (*pfShutdown)
550 goto end;
551
552 if (rc != VERR_TIMEOUT && RT_FAILURE(rc))
553 {
554 VBoxServiceError("RTSemEventMultiWait failed; rc=%Rrc\n", rc);
555 goto end;
556 }
557
558 /*
559 * Now enter the loop retrieving runtime data continuously.
560 */
561 for (;;)
562 {
563 VBoxServiceVerbose(3, "VBoxServicePageSharingWorker: enabled=%d\n", VbglR3PageSharingIsEnabled());
564
565 if (VbglR3PageSharingIsEnabled())
566 VBoxServicePageSharingInspectGuest();
567
568 /*
569 * Block for a minute.
570 *
571 * The event semaphore takes care of ignoring interruptions and it
572 * allows us to implement service wakeup later.
573 */
574 if (*pfShutdown)
575 break;
576 rc = RTSemEventMultiWait(g_PageSharingEvent, 60000);
577 if (*pfShutdown)
578 break;
579 if (rc != VERR_TIMEOUT && RT_FAILURE(rc))
580 {
581 VBoxServiceError("RTSemEventMultiWait failed; rc=%Rrc\n", rc);
582 break;
583 }
584 }
585
586end:
587 RTSemEventMultiDestroy(g_PageSharingEvent);
588 g_PageSharingEvent = NIL_RTSEMEVENTMULTI;
589
590 VBoxServiceVerbose(3, "VBoxServicePageSharingWorker: finished thread\n");
591 return 0;
592}
593
594/** @copydoc VBOXSERVICE::pfnTerm */
595static DECLCALLBACK(void) VBoxServicePageSharingTerm(void)
596{
597 VBoxServiceVerbose(3, "VBoxServicePageSharingTerm\n");
598
599#if defined(RT_OS_WINDOWS) && !defined(TARGET_NT4)
600 if (hNtdll)
601 FreeLibrary(hNtdll);
602#endif
603 return;
604}
605
606
607/** @copydoc VBOXSERVICE::pfnStop */
608static DECLCALLBACK(void) VBoxServicePageSharingStop(void)
609{
610 RTSemEventMultiSignal(g_PageSharingEvent);
611}
612
613
614/**
615 * The 'pagesharing' service description.
616 */
617VBOXSERVICE g_PageSharing =
618{
619 /* pszName. */
620 "pagesharing",
621 /* pszDescription. */
622 "Page Sharing",
623 /* pszUsage. */
624 NULL,
625 /* pszOptions. */
626 NULL,
627 /* methods */
628 VBoxServicePageSharingPreInit,
629 VBoxServicePageSharingOption,
630 VBoxServicePageSharingInit,
631 VBoxServicePageSharingWorker,
632 VBoxServicePageSharingStop,
633 VBoxServicePageSharingTerm
634};
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