1 | //
|
---|
2 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
---|
3 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
---|
4 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
---|
5 | // PARTICULAR PURPOSE.
|
---|
6 | //
|
---|
7 | // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
|
---|
8 | //
|
---|
9 | // Helper functions for copying parameters and packaging the buffer
|
---|
10 | // for GetSerialization.
|
---|
11 | //
|
---|
12 | // Modifications (c) 2009-2010 Oracle Corporation
|
---|
13 | //
|
---|
14 |
|
---|
15 | #pragma once
|
---|
16 | #include "common.h"
|
---|
17 | #include <windows.h>
|
---|
18 | #include <strsafe.h>
|
---|
19 |
|
---|
20 | #pragma warning(push)
|
---|
21 | #pragma warning(disable : 4995)
|
---|
22 | #include <shlwapi.h>
|
---|
23 | #pragma warning(pop)
|
---|
24 |
|
---|
25 |
|
---|
26 |
|
---|
27 | //makes a copy of a field descriptor using CoTaskMemAlloc
|
---|
28 | HRESULT FieldDescriptorCoAllocCopy(
|
---|
29 | const CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR& rcpfd,
|
---|
30 | CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR** ppcpfd
|
---|
31 | );
|
---|
32 |
|
---|
33 | //makes a copy of a field descriptor on the normal heap
|
---|
34 | HRESULT FieldDescriptorCopy(
|
---|
35 | const CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR& rcpfd,
|
---|
36 | CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR* pcpfd
|
---|
37 | );
|
---|
38 |
|
---|
39 | //creates a UNICODE_STRING from a normal string
|
---|
40 | HRESULT UnicodeStringInitWithString(
|
---|
41 | PWSTR pwz,
|
---|
42 | UNICODE_STRING* pus
|
---|
43 | );
|
---|
44 |
|
---|
45 | //packages the credentials into the buffer that the system expects
|
---|
46 | HRESULT KerbInteractiveLogonPack(
|
---|
47 | const KERB_INTERACTIVE_LOGON& rkil,
|
---|
48 | BYTE** prgb,
|
---|
49 | DWORD* pcb
|
---|
50 | );
|
---|
51 |
|
---|
52 | //unpackages the "packed" version of the creds in-place into the "unpacked" version
|
---|
53 | void KerbInteractiveLogonUnpackInPlace(
|
---|
54 | KERB_INTERACTIVE_UNLOCK_LOGON* pkiul
|
---|
55 | );
|
---|
56 |
|
---|
57 |
|
---|
58 | //get the authentication package that will be used for our logon attempt
|
---|
59 | HRESULT RetrieveNegotiateAuthPackage(
|
---|
60 | ULONG * pulAuthPackage
|
---|
61 | );
|
---|