B
Bill
I am trying to call AcquireCredentialsHandle using Interop by I get a
notsupportexception. The MSDN docs say it is supported. Has anyone got
this working? I tried it with both the ce and pocketpc emulators and both
give the same error. I also tried linking to both secur32.dll and
security.dll and neither worked.
Here is the call:
status = AcquireCredentialsHandle(
0,
"NTLM",
SECPKG_CRED_OUTBOUND,
0, ref pAuthData,
0, 0,
m_Credentials,
ref Expiration);
//Def
[StructLayout(LayoutKind.Sequential)]
internal struct SEC_WINNT_AUTH_IDENTITY
{
public string User;
public int UserLength;
public string Domain;
public int DomainLength;
public string Password;
public int PasswordLength;
public int Flags;
}
[DllImport(@"secur32.dll", EntryPoint="InitializeSecurityContext")]
internal static extern int InitializeSecurityContext(IntPtr phCredential,
IntPtr phContext, string pszTargetName, int fContextReq, int Reserved1, int
TargetDataRep, IntPtr pInput, int Reserved2, IntPtr phNewContext, ref
SecBufferDesc pOutput, ref int pfContextAttr, IntPtr ptsExpiry);
notsupportexception. The MSDN docs say it is supported. Has anyone got
this working? I tried it with both the ce and pocketpc emulators and both
give the same error. I also tried linking to both secur32.dll and
security.dll and neither worked.
Here is the call:
status = AcquireCredentialsHandle(
0,
"NTLM",
SECPKG_CRED_OUTBOUND,
0, ref pAuthData,
0, 0,
m_Credentials,
ref Expiration);
//Def
[StructLayout(LayoutKind.Sequential)]
internal struct SEC_WINNT_AUTH_IDENTITY
{
public string User;
public int UserLength;
public string Domain;
public int DomainLength;
public string Password;
public int PasswordLength;
public int Flags;
}
[DllImport(@"secur32.dll", EntryPoint="InitializeSecurityContext")]
internal static extern int InitializeSecurityContext(IntPtr phCredential,
IntPtr phContext, string pszTargetName, int fContextReq, int Reserved1, int
TargetDataRep, IntPtr pInput, int Reserved2, IntPtr phNewContext, ref
SecBufferDesc pOutput, ref int pfContextAttr, IntPtr ptsExpiry);