From 26a428ce2675867f850195c20582f8339290e87c Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Tue, 25 Apr 2006 15:50:33 +0000 Subject: [PATCH] Add 1 to the length of IDs to comply with native code. --- c_sharp/NSSCSWrapper/NativeCalls.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/c_sharp/NSSCSWrapper/NativeCalls.cs b/c_sharp/NSSCSWrapper/NativeCalls.cs index 56c2b015..dc359083 100644 --- a/c_sharp/NSSCSWrapper/NativeCalls.cs +++ b/c_sharp/NSSCSWrapper/NativeCalls.cs @@ -1075,12 +1075,12 @@ namespace Novell.CASA SSCS_SECRET_ID_T appSecretID = new SSCS_SECRET_ID_T(); appSecretID.id = sAppSecretID; - appSecretID.len = sAppSecretID.Length; + appSecretID.len = sAppSecretID.Length + 1; SSCS_SECRET_ID_T sharedID = new SSCS_SECRET_ID_T(); if (sSharedSecretID != null) { - sharedID.len = sSharedSecretID.Length; + sharedID.len = sSharedSecretID.Length + 1; sharedID.id = sSharedSecretID; } @@ -1146,22 +1146,22 @@ namespace Novell.CASA SSCS_SECRET_ID_T appSecretID = new SSCS_SECRET_ID_T(); appSecretID.id = sAppSecretID; - appSecretID.len = sAppSecretID.Length; + appSecretID.len = sAppSecretID.Length + 1; SSCS_SECRET_ID_T sharedID = new SSCS_SECRET_ID_T(); if (sSharedSecretID != null) { - sharedID.len = sSharedSecretID.Length; + sharedID.len = sSharedSecretID.Length + 1; sharedID.id = sSharedSecretID; } SSCS_BASIC_CREDENTIAL_UTF8 credential = new SSCS_BASIC_CREDENTIAL_UTF8(); credential.unFlags = unFlag; - credential.unLen = GetUTF8ByteCount(sUsername); + credential.unLen = GetUTF8ByteCount(sUsername) + 1; credential.username = GetUTF8FromString(sUsername, USERNAME_LEN); - credential.pwordLen = GetUTF8ByteCount(sPassword); + credential.pwordLen = GetUTF8ByteCount(sPassword) + 1; credential.password = GetUTF8FromString(sPassword, PASSWORD_LEN); IntPtr pCredential = Marshal.AllocHGlobal(Marshal.SizeOf(credential)); @@ -1196,12 +1196,12 @@ namespace Novell.CASA int rcode; SSCS_SECRET_ID_T appSecretID = new SSCS_SECRET_ID_T(); appSecretID.id = sAppSecretID; - appSecretID.len = sAppSecretID.Length; + appSecretID.len = sAppSecretID.Length + 1; SSCS_SECRET_ID_T sharedID = new SSCS_SECRET_ID_T(); if (sSharedSecretID != null) { - sharedID.len = sSharedSecretID.Length; + sharedID.len = sSharedSecretID.Length + 1; sharedID.id = sSharedSecretID; }