1 | /* $Id: symdb.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IPRT - Internal Header for the NT Ring-0 Driver Symbol DB.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2013-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * The contents of this file may alternatively be used under the terms
|
---|
26 | * of the Common Development and Distribution License Version 1.0
|
---|
27 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
28 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
29 | * CDDL are applicable instead of those of the GPL.
|
---|
30 | *
|
---|
31 | * You may elect to license modified versions of this file under the
|
---|
32 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
33 | *
|
---|
34 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
35 | */
|
---|
36 |
|
---|
37 | #ifndef IPRT_INCLUDED_SRC_r0drv_nt_symdb_h
|
---|
38 | #define IPRT_INCLUDED_SRC_r0drv_nt_symdb_h
|
---|
39 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
40 | # pragma once
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | #include <iprt/types.h>
|
---|
44 |
|
---|
45 |
|
---|
46 | /**
|
---|
47 | * NT Version info.
|
---|
48 | */
|
---|
49 | typedef struct RTNTSDBOSVER
|
---|
50 | {
|
---|
51 | /** The major version number. */
|
---|
52 | uint8_t uMajorVer;
|
---|
53 | /** The minor version number. */
|
---|
54 | uint8_t uMinorVer;
|
---|
55 | /** Set if checked build, clear if free (retail) build. */
|
---|
56 | uint8_t fChecked : 1;
|
---|
57 | /** Set if multi processor kernel. */
|
---|
58 | uint8_t fSmp : 1;
|
---|
59 | /** The service pack number. */
|
---|
60 | uint8_t uCsdNo : 6;
|
---|
61 | /** The build number. */
|
---|
62 | uint32_t uBuildNo;
|
---|
63 | } RTNTSDBOSVER;
|
---|
64 | /** Pointer to NT version info. */
|
---|
65 | typedef RTNTSDBOSVER *PRTNTSDBOSVER;
|
---|
66 | /** Pointer to const NT version info. */
|
---|
67 | typedef RTNTSDBOSVER const *PCRTNTSDBOSVER;
|
---|
68 |
|
---|
69 |
|
---|
70 | /**
|
---|
71 | * Compare NT OS version structures.
|
---|
72 | *
|
---|
73 | * @retval 0 if equal
|
---|
74 | * @retval 1 if @a pInfo1 is newer/greater than @a pInfo2
|
---|
75 | * @retval -1 if @a pInfo1 is older/less than @a pInfo2
|
---|
76 | *
|
---|
77 | * @param pInfo1 The first version info structure.
|
---|
78 | * @param pInfo2 The second version info structure.
|
---|
79 | */
|
---|
80 | DECLINLINE(int) rtNtOsVerInfoCompare(PCRTNTSDBOSVER pInfo1, PCRTNTSDBOSVER pInfo2)
|
---|
81 | {
|
---|
82 | if (pInfo1->uMajorVer != pInfo2->uMajorVer)
|
---|
83 | return pInfo1->uMajorVer > pInfo2->uMajorVer ? 1 : -1;
|
---|
84 | if (pInfo1->uMinorVer != pInfo2->uMinorVer)
|
---|
85 | return pInfo1->uMinorVer > pInfo2->uMinorVer ? 1 : -1;
|
---|
86 | if (pInfo1->uBuildNo != pInfo2->uBuildNo)
|
---|
87 | return pInfo1->uBuildNo > pInfo2->uBuildNo ? 1 : -1;
|
---|
88 | if (pInfo1->uCsdNo != pInfo2->uCsdNo)
|
---|
89 | return pInfo1->uCsdNo > pInfo2->uCsdNo ? 1 : -1;
|
---|
90 | if (pInfo1->fSmp != pInfo2->fSmp)
|
---|
91 | return pInfo1->fSmp > pInfo2->fSmp ? 1 : -1;
|
---|
92 | if (pInfo1->fChecked != pInfo2->fChecked)
|
---|
93 | return pInfo1->fChecked > pInfo2->fChecked ? 1 : -1;
|
---|
94 | return 0;
|
---|
95 | }
|
---|
96 |
|
---|
97 | #endif /* !IPRT_INCLUDED_SRC_r0drv_nt_symdb_h */
|
---|
98 |
|
---|