mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-22 09:15:54 +02:00
Moved SECBUFFER_VERSION definition to SecBufferDesc
This commit is contained in:
parent
ee65a99a92
commit
2b52d4b84c
2 changed files with 3 additions and 2 deletions
|
@ -12,7 +12,6 @@ namespace SMBLibrary.Win32.Security
|
||||||
{
|
{
|
||||||
public enum SecBufferType : uint
|
public enum SecBufferType : uint
|
||||||
{
|
{
|
||||||
SECBUFFER_VERSION = 0,
|
|
||||||
SECBUFFER_EMPTY = 0,
|
SECBUFFER_EMPTY = 0,
|
||||||
SECBUFFER_DATA = 1,
|
SECBUFFER_DATA = 1,
|
||||||
SECBUFFER_TOKEN = 2
|
SECBUFFER_TOKEN = 2
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace SMBLibrary.Win32.Security
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct SecBufferDesc : IDisposable
|
public struct SecBufferDesc : IDisposable
|
||||||
{
|
{
|
||||||
|
public const uint SECBUFFER_VERSION = 0;
|
||||||
|
|
||||||
public uint ulVersion;
|
public uint ulVersion;
|
||||||
public uint cBuffers; // Indicates the number of SecBuffer structures in the pBuffers array.
|
public uint cBuffers; // Indicates the number of SecBuffer structures in the pBuffers array.
|
||||||
public IntPtr pBuffers; // Pointer to an array of SecBuffer structures.
|
public IntPtr pBuffers; // Pointer to an array of SecBuffer structures.
|
||||||
|
@ -24,7 +26,7 @@ namespace SMBLibrary.Win32.Security
|
||||||
public SecBufferDesc(SecBuffer[] buffers)
|
public SecBufferDesc(SecBuffer[] buffers)
|
||||||
{
|
{
|
||||||
int secBufferSize = Marshal.SizeOf(typeof(SecBuffer));
|
int secBufferSize = Marshal.SizeOf(typeof(SecBuffer));
|
||||||
ulVersion = (uint)SecBufferType.SECBUFFER_VERSION;
|
ulVersion = SECBUFFER_VERSION;
|
||||||
cBuffers = (uint)buffers.Length;
|
cBuffers = (uint)buffers.Length;
|
||||||
pBuffers = Marshal.AllocHGlobal(buffers.Length * secBufferSize);
|
pBuffers = Marshal.AllocHGlobal(buffers.Length * secBufferSize);
|
||||||
IntPtr currentBuffer = pBuffers;
|
IntPtr currentBuffer = pBuffers;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue