-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStructures.cs
98 lines (74 loc) · 3.4 KB
/
Structures.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//
// @(#) Structures.cs
//
// Project: usis.Data.LocalDb
// System: Microsoft Visual Studio 2022
// Author: Udo Schäfer
//
// Copyright (c) 2018-2023 usis GmbH. All rights reserved.
using System.Runtime.InteropServices;
namespace usis.Data.LocalDb
{
#region LocalDBVersionInfo structure
// ----------------------------
// LocalDBVersionInfo structure
// ----------------------------
[StructLayout(LayoutKind.Sequential)]
internal struct LocalDBVersionInfo
{
// contains the size of the LocalDBVersionInfo struct
internal uint LocalDBVersionInfoSize;
// holds the version name
[MarshalAs(UnmanagedType.ByValArray, SizeConst = (Constants.MAX_LOCALDB_VERSION_LENGTH + 1) * sizeof(char))]
internal byte[] Version;
// TRUE if the instance files exist on disk, FALSE otherwise
internal bool Exists;
// holds the LocalDB version for the instance in the format: major.minor.build.revision
internal uint Major;
internal uint Minor;
internal uint Build;
internal uint Revision;
}
#endregion
#region LocalDBInstanceInfo structure
// -----------------------------
// LocalDBInstanceInfo structure
// -----------------------------
[StructLayout(LayoutKind.Sequential)]
internal struct LocalDBInstanceInfo
{
// contains the size of the LocalDBInstanceInfo struct
internal uint LocalDBInstanceInfoSize;
// holds the instance name
[MarshalAs(UnmanagedType.ByValArray, SizeConst = (Constants.MAX_LOCALDB_INSTANCE_NAME_LENGTH + 1) * sizeof(char))]
internal byte[] InstanceName;
// TRUE if the instance files exist on disk, FALSE otherwise
internal bool Exists;
// TRUE if the instance configuration registry is corrupted, FALSE otherwise
internal bool ConfigurationCorrupted;
// TRUE if the instance is running at the moment, FALSE otherwise
internal bool IsRunning;
// holds the LocalDB version for the instance in the format: major.minor.build.revision
internal uint Major;
internal uint Minor;
internal uint Build;
internal uint Revision;
// holds the date and time when the instance was started for the last time
internal System.Runtime.InteropServices.ComTypes.FILETIME LastStartUTC;
// holds the name of the TDS named pipe to connect to the instance
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.LOCALDB_MAX_SQLCONNECTION_BUFFER_SIZE * sizeof(char))]
internal byte[] Connection;
// TRUE if the instance is shared, FALSE otherwise
internal bool IsShared;
// holds the shared name for the instance (if the instance is shared)
[MarshalAs(UnmanagedType.ByValArray, SizeConst = (Constants.MAX_LOCALDB_INSTANCE_NAME_LENGTH + 1) * sizeof(char))]
internal byte[] SharedInstanceName;
// holds the SID of the instance owner (if the instance is shared)
[MarshalAs(UnmanagedType.ByValArray, SizeConst = (Constants.MAX_STRING_SID_LENGTH + 1) * sizeof(char))]
internal byte[] OwnerSID;
// TRUE if the instance is Automatic, FALSE otherwise
internal bool IsAutomatic;
}
#endregion
}
// eof "Structures.cs"