sam.h (1708B)
1/** 2 * WinPR: Windows Portable Runtime 3 * Security Accounts Manager (SAM) 4 * 5 * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com> 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20#ifndef WINPR_UTILS_SAM_H 21#define WINPR_UTILS_SAM_H 22 23#include <winpr/winpr.h> 24#include <winpr/wtypes.h> 25 26typedef struct winpr_sam WINPR_SAM; 27 28struct winpr_sam_entry 29{ 30 LPSTR User; 31 UINT32 UserLength; 32 LPSTR Domain; 33 UINT32 DomainLength; 34 BYTE LmHash[16]; 35 BYTE NtHash[16]; 36}; 37typedef struct winpr_sam_entry WINPR_SAM_ENTRY; 38 39#ifdef __cplusplus 40extern "C" 41{ 42#endif 43 44 WINPR_API WINPR_SAM_ENTRY* SamLookupUserA(WINPR_SAM* sam, LPSTR User, UINT32 UserLength, 45 LPSTR Domain, UINT32 DomainLength); 46 WINPR_API WINPR_SAM_ENTRY* SamLookupUserW(WINPR_SAM* sam, LPWSTR User, UINT32 UserLength, 47 LPWSTR Domain, UINT32 DomainLength); 48 49 WINPR_API void SamResetEntry(WINPR_SAM_ENTRY* entry); 50 WINPR_API void SamFreeEntry(WINPR_SAM* sam, WINPR_SAM_ENTRY* entry); 51 52 WINPR_API WINPR_SAM* SamOpen(const char* filename, BOOL readOnly); 53 WINPR_API void SamClose(WINPR_SAM* sam); 54 55#ifdef __cplusplus 56} 57#endif 58 59#endif /* WINPR_UTILS_SAM_H */