VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/VBoxGINA/testcase/tstVBoxGINA.cpp@ 95874

最後變更 在這個檔案從95874是 95874,由 vboxsync 提交於 3 年 前

Add/Nt/VBoxGINA: Made it build in VBOX_WITH_NOCRT_STATIC mode. bugref:10261

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 1.6 KB
 
1/* $Id: tstVBoxGINA.cpp 95874 2022-07-27 08:01:09Z vboxsync $ */
2/** @file
3 * tstVBoxGINA.cpp - Simple testcase for invoking VBoxGINA.dll.
4 */
5
6/*
7 * Copyright (C) 2012-2022 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.alldomusa.eu.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
18#include <iprt/win/windows.h>
19#include <iprt/stream.h>
20
21int main()
22{
23 DWORD dwErr;
24
25 /*
26 * Be sure that:
27 * - the debug VBoxGINA gets loaded instead of a maybe installed
28 * release version in "C:\Windows\system32".
29 */
30
31 HMODULE hMod = LoadLibraryW(L"VBoxGINA.dll");
32 if (hMod)
33 {
34 RTPrintf("VBoxGINA found\n");
35
36 FARPROC pfnDebug = GetProcAddress(hMod, "VBoxGINADebug");
37 if (!pfnDebug)
38 {
39 RTPrintf("Calling VBoxGINA ...\n");
40 dwErr = pfnDebug();
41 }
42 else
43 {
44 dwErr = GetLastError();
45 RTPrintf("Could not load VBoxGINADebug, error=%u\n", dwErr);
46 }
47
48 FreeLibrary(hMod);
49 }
50 else
51 {
52 dwErr = GetLastError();
53 RTPrintf("VBoxGINA.dll not found, error=%u\n", dwErr);
54 }
55
56 RTPrintf("Test returned: %s (%u)\n", dwErr == ERROR_SUCCESS ? "SUCCESS" : "FAILURE", dwErr);
57 return dwErr == ERROR_SUCCESS ? 0 : 1;
58}
59
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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