Add 1 to the length of IDs to comply with native code.

This commit is contained in:
Jim Norman 2006-04-25 15:50:33 +00:00
parent 5f4ac7abec
commit 26a428ce26

View File

@ -1075,12 +1075,12 @@ namespace Novell.CASA
SSCS_SECRET_ID_T appSecretID = new SSCS_SECRET_ID_T(); SSCS_SECRET_ID_T appSecretID = new SSCS_SECRET_ID_T();
appSecretID.id = sAppSecretID; appSecretID.id = sAppSecretID;
appSecretID.len = sAppSecretID.Length; appSecretID.len = sAppSecretID.Length + 1;
SSCS_SECRET_ID_T sharedID = new SSCS_SECRET_ID_T(); SSCS_SECRET_ID_T sharedID = new SSCS_SECRET_ID_T();
if (sSharedSecretID != null) if (sSharedSecretID != null)
{ {
sharedID.len = sSharedSecretID.Length; sharedID.len = sSharedSecretID.Length + 1;
sharedID.id = sSharedSecretID; sharedID.id = sSharedSecretID;
} }
@ -1146,22 +1146,22 @@ namespace Novell.CASA
SSCS_SECRET_ID_T appSecretID = new SSCS_SECRET_ID_T(); SSCS_SECRET_ID_T appSecretID = new SSCS_SECRET_ID_T();
appSecretID.id = sAppSecretID; appSecretID.id = sAppSecretID;
appSecretID.len = sAppSecretID.Length; appSecretID.len = sAppSecretID.Length + 1;
SSCS_SECRET_ID_T sharedID = new SSCS_SECRET_ID_T(); SSCS_SECRET_ID_T sharedID = new SSCS_SECRET_ID_T();
if (sSharedSecretID != null) if (sSharedSecretID != null)
{ {
sharedID.len = sSharedSecretID.Length; sharedID.len = sSharedSecretID.Length + 1;
sharedID.id = sSharedSecretID; sharedID.id = sSharedSecretID;
} }
SSCS_BASIC_CREDENTIAL_UTF8 credential = new SSCS_BASIC_CREDENTIAL_UTF8(); SSCS_BASIC_CREDENTIAL_UTF8 credential = new SSCS_BASIC_CREDENTIAL_UTF8();
credential.unFlags = unFlag; credential.unFlags = unFlag;
credential.unLen = GetUTF8ByteCount(sUsername); credential.unLen = GetUTF8ByteCount(sUsername) + 1;
credential.username = GetUTF8FromString(sUsername, USERNAME_LEN); credential.username = GetUTF8FromString(sUsername, USERNAME_LEN);
credential.pwordLen = GetUTF8ByteCount(sPassword); credential.pwordLen = GetUTF8ByteCount(sPassword) + 1;
credential.password = GetUTF8FromString(sPassword, PASSWORD_LEN); credential.password = GetUTF8FromString(sPassword, PASSWORD_LEN);
IntPtr pCredential = Marshal.AllocHGlobal(Marshal.SizeOf(credential)); IntPtr pCredential = Marshal.AllocHGlobal(Marshal.SizeOf(credential));
@ -1196,12 +1196,12 @@ namespace Novell.CASA
int rcode; int rcode;
SSCS_SECRET_ID_T appSecretID = new SSCS_SECRET_ID_T(); SSCS_SECRET_ID_T appSecretID = new SSCS_SECRET_ID_T();
appSecretID.id = sAppSecretID; appSecretID.id = sAppSecretID;
appSecretID.len = sAppSecretID.Length; appSecretID.len = sAppSecretID.Length + 1;
SSCS_SECRET_ID_T sharedID = new SSCS_SECRET_ID_T(); SSCS_SECRET_ID_T sharedID = new SSCS_SECRET_ID_T();
if (sSharedSecretID != null) if (sSharedSecretID != null)
{ {
sharedID.len = sSharedSecretID.Length; sharedID.len = sSharedSecretID.Length + 1;
sharedID.id = sSharedSecretID; sharedID.id = sSharedSecretID;
} }