7¤0ìvXÀV<°£Í0Ã0Ã0ÃÀU­ÿË”™ÐJ(}cdg L Ánr"4y¥oÚÃOŒŽ"$2%ÿÛ@ì W+Ÿ3  �I$�@¢©ºô€ÈÉF„KH…EÄñhPÉ² ÉqE!dŒAÈdˆhd   äy9§                     AM_LOGON_RESPONSE_EX(struct ndr_print *ndr, const char *name, conGTH),unique] */
		uint32_t dwDesiredAccess;
		uint32_t dwServiceType;
		uint32_t dwStartType;
		uint32_t dwErrorControl;
		const char *lpBinaryPathName;/* [charset(UTF16),range(0,SC_MAX_PATH_LENGTH),ref] */
		const char *lpLoadOrderGroup;/* [charset(UTF16),range(0,SC_MAX_NAME_LENGTH),unique] */
		uint8_t *lpDependencies;/* [size_is(dwDependSize),unique] */
		uint32_t dwDependSize;/* [range(0,SC_MAX_DEPEND_SIZE)] */
		const char *lpServiceStartName;/* [charset(UTF16),range(0,SC_MAX_ACCOUNT_NAME_LENGTH),unique] */
		uint8_t *lpPassword;/* [size_is(dwPwSize),unique] */
		uint32_t dwPwSize;/* [range(0,SC_MAX_PWD_SIZE)] */
		uint32_t *lpdwTagId;/* [unique] */
	} in;

	struct {
		struct policy_handle *lpServiceHandle;/* [ref] */
		uint32_t *lpdwTagId;/* [unique] */
		WERROR result;
	} out;

};


struct Opnum46NotUsedOnWire {
	int _dummy_element;
};


struct svcctl_NotifyServiceStatusChange {
	struct {
		struct policy_handle hService;
		struct SC_RPC_NOTIFY_PARAMS NotifyParams;
		struct GUID *pClientProcessGuid;/* [SERVICEPACK_UNINSTALL ( 0x00000013 )
#define SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL ( 0x00000014 )
#define SERVICE_STOP_REASON_MINOR_SECURITYFIX_UNINSTALL ( 0x00000015 )
#define SERVICE_STOP_REASON_MINOR_MMC ( 0x00000016 )
#define SERVICE_STOP_REASON_MINOR_NONE ( 0x00000017 )
#endif
;

struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA {
	uint32_t dwReason;
	const char *szComment;/* [charset(DOS),range(0,SC_MAX_COMMENT_LENGTH),unique] */
};

struct SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS {
	struct SERVICE_STATUS_PROCESS ServiceStatus;
};

union SC_RPC_SERVICE_CONTROL_IN_PARAMSA {
	struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA *psrInParams;/* [case,unique] */
}/* [switch_type(uint32)] */;

union SC_RPC_SERVICE_CONTROL_OUT_PARAMSA {
	struct SERVICE_CONTROL_STATUS_REASON_OUT_PARAMS *psrOutParams;/* [case,unique] */
}/* [switch_type(uint32)] */;

struct SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW {
	uint32_t dwReason;
	const char *pszCommeC_START ( 0x0010 )
#define SC_RIGHT_SVC_STOP ( 0x0020 )
#define SC_RIGHT_SVC_PAUSE_CONTINUE ( 0x0040 )
#define SC_RIGHT_SVC_INTERROGATE ( 0x0080 )
#define SC_RIGHT_SVC_USER_DEFINED_CONTROL ( 0x0100 )

struct QUERY_SERVICE_CONFIG {
	uint32_t service_type;
	enum svcctl_StartType start_type;
	enum svcctl_ErrorControl error_control;
	const char *executablepath;/* [charset(UTF16),range(0,8192),unique] */
	const char *loadordergroup;/* [charset(UTF16),range(0,8192),unique] */
	uint32_t tag_id;
	const char *dependencies;/* [charset(UTF16),range(0,8192),unique] */
	const char *startname;/* [charset(UTF16),range(0,8192),unique] */
	const char *displayname;/* [charset(UTF16),range(0,8192),unique] */
}/* [gensize,public] */;

struct svcctl_ArgumentString {
	const char *string;/* [charset(UTF16),range(0,SC_MAX_ARGUMENT_LENGTH),unique] */
};

enum svcctl_ConfigLevel
#ifndef USE_UINT_ENUMS
 {
	SERVICE_CONFIG_DESCRIPTION=(int)(0x00000001),
	SERVICE_CONFIG_FAILURE_ACTIONS=(int)(0x00000002)
}
#else
 { __do_not_use_enum_svcctlC_CTX *ctx, DATA_BLOB *blob);

struct tdr_push *tdr_push_init(TALLOC_CTX *mem_ctx);
struct tdr_pull *tdr_pull_init(TALLOC_CTX *mem_ctx);

NTSTATUS tdr_push_to_fd(int fd, tdr_push_fn_t push_fn, const void *p);
void tdr_print_debug_helper(struct tdr_print *tdr, const char *format, ...) PRINTF_ATTRIBUTE(2,3);

#endif /* __TDR_H__ */
/* header auto-generated by pidl */

#ifndef _PIDL_HEADER_svcctl
#define _PIDL_HEADER_svcctl

#include <stdint.h>


#include <gen_ndr/misc.h>
#include <gen_ndr/security.h>
#ifndef _HEADER_svcctl
#define _HEADER_svcctl

#define MAX_SERVICE_NAME_LENGTH	( 256 )
#define SC_MAX_DEPEND_SIZE	( 4*1024 )
#define SC_MAX_NAME_LENGTH	( MAX_SERVICE_NAME_LENGTH+1 )
#define SC_MAX_PATH_LENGTH	( 32*1024 )
#define SC_MAX_PWD_SIZE	( 514 )
#define SC_MAX_COMPUTER_NAME_LENGTH	( 1024 )
#define SC_MAX_ACCOUNT_NAME_LENGTH	( 2*1024 )
#define SC_MAX_COMMENT_LENGTH	( 128 )
#define SC_MAX_ARGUMENT_LENGTH	( 1024 )
#define SC_MAX_ARGUMENTS	( 1024 )
#define SVCCTL_ACCEPT_NONE	( 0x00000000 )
#define SERVICE_TYPE_KIPSEC_IKE_CGA_AUTH_FAILED W_ERROR(0x3644)
#define WERR_IPSEC_IKE_PROCESS_ERR_NATOA W_ERROR(0x3645)
#define WERR_IPSEC_IKE_INVALID_MM_FOR_QM W_ERROR(0x3646)
#define WERR_IPSEC_IKE_QM_EXPIRED W_ERROR(0x3647)
#define WERR_IPSEC_IKE_TOO_MANY_FILTERS W_ERROR(0x3648)
#define WERR_IPSEC_IKE_NEG_STATUS_END W_ERROR(0x3649)
#define WERR_SXS_SECTION_NOT_FOUND W_ERROR(0x36b0)
#define WERR_SXS_CANT_GEN_ACTCTX W_ERROR(0x36b1)
#define WERR_SXS_INVALID_ACTCTXDATA_FORMAT W_ERROR(0x36b2)
#define WERR_SXS_ASSEMBLY_NOT_FOUND W_ERROR(0x36b3)
#define WERR_SXS_MANIFEST_FORMAT_ERROR W_ERROR(0x36b4)
#define WERR_SXS_MANIFEST_PARSE_ERROR W_ERROR(0x36b5)
#define WERR_SXS_ACTIVATION_CONTEXT_DISABLED W_ERROR(0x36b6)
#define WERR_SXS_KEY_NOT_FOUND W_ERROR(0x36b7)
#define WERR_SXS_VERSION_CONFLICT W_ERROR(0x36b8)
#define WERR_SXS_WRONG_SECTION_TYPE W_ERROR(0x36b9)
#define WERR_SXS_THREAD_QUERIES_DISABLED W_ERROR(0x36ba)
#define WERR_SXS_PROCESS_DEFAULT_ALREADY_SET W_ERROR(0x36bb)
#define WERR_SXS_UNKNOWN_ENCODING_GROUP W_ERROR(0x36bc)
#defNTAINER_CANNOT_BE_SPECIAL W_ERROR(0x21a3)
#define WERR_DS_DOMAIN_RENAME_IN_PROGRESS W_ERROR(0x21a4)
#define WERR_DS_EXISTING_AD_CHILD_NC W_ERROR(0x21a5)
#define WERR_DS_REPL_LIFETIME_EXCEEDED W_ERROR(0x21a6)
#define WERR_DS_DISALLOWED_IN_SYSTEM_CONTAINER W_ERROR(0x21a7)
#define WERR_DS_LDAP_SEND_QUEUE_FULL W_ERROR(0x21a8)
#define WERR_DS_DRA_OUT_SCHEDULE_WINDOW W_ERROR(0x21a9)
#define WERR_DS_POLICY_NOT_KNOWN W_ERROR(0x21aa)
#define WERR_NO_SITE_SETTINGS_OBJECT W_ERROR(0x21ab)
#define WERR_NO_SECRETS W_ERROR(0x21ac)
#define WERR_NO_WRITABLE_DC_FOUND W_ERROR(0x21ad)
#define WERR_DS_NO_SERVER_OBJECT W_ERROR(0x21ae)
#define WERR_DS_NO_NTDSA_OBJECT W_ERROR(0x21af)
#define WERR_DS_NON_ASQ_SEARCH W_ERROR(0x21b0)
#define WERR_DS_AUDIT_FAILURE W_ERROR(0x21b1)
#define WERR_DS_INVALID_SEARCH_FLAG_SUBTREE W_ERROR(0x21b2)
#define WERR_DS_INVALID_SEARCH_FLAG_TUPLE W_ERROR(0x21b3)
#define WERR_DS_DRA_RECYCLED_TARGET W_ERROR(0x21bf)
#define WERR_DS_HIGH_DSA_VERSION W_ERROR(0x21c2)
#define WERR_DS_SPN_VALUE_NOT_UNIQUE_IN_FORNT_HAVE_UNIVERSAL_MEMBER W_ERROR(0x2145)
#define WERR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER W_ERROR(0x2146)
#define WERR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER W_ERROR(0x2147)
#define WERR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER W_ERROR(0x2148)
#define WERR_DS_HAVE_PRIMARY_MEMBERS W_ERROR(0x2149)
#define WERR_DS_STRING_SD_CONVERSION_FAILED W_ERROR(0x214a)
#define WERR_DS_NAMING_MASTER_GC W_ERROR(0x214b)
#define WERR_DS_DNS_LOOKUP_FAILURE W_ERROR(0x214c)
#define WERR_DS_COULDNT_UPDATE_SPNS W_ERROR(0x214d)
#define WERR_DS_CANT_RETRIEVE_SD W_ERROR(0x214e)
#define WERR_DS_KEY_NOT_UNIQUE W_ERROR(0x214f)
#define WERR_DS_WRONG_LINKED_ATT_SYNTAX W_ERROR(0x2150)
#define WERR_DS_SAM_NEED_BOOTKEY_PASSWORD W_ERROR(0x2151)
#define WERR_DS_SAM_NEED_BOOTKEY_FLOPPY W_ERROR(0x2152)
#define WERR_DS_CANT_START W_ERROR(0x2153)
#define WERR_DS_INIT_FAILURE W_ERROR(0x2154)
#define WERR_DS_NO_PKT_PRIVACY_ON_CONNECTION W_ERROR(0x2155)
#define WERR_DS_SOURCE_DOMAIN_IN_FOREST W_ERROR(0x2156)
#define WERR_DS_DESTINATION_DOMAIN_NOT_IN WERR_FRS_ERR_INVALID_SERVICE_PARAMETER W_ERROR(0x1f51)
#define WERR_DS_NOT_INSTALLED W_ERROR(0x2008)
#define WERR_DS_MEMBERSHIP_EVALUATED_LOCALLY W_ERROR(0x2009)
#define WERR_DS_NO_ATTRIBUTE_OR_VALUE W_ERROR(0x200a)
#define WERR_DS_INVALID_ATTRIBUTE_SYNTAX W_ERROR(0x200b)
#define WERR_DS_ATTRIBUTE_TYPE_UNDEFINED W_ERROR(0x200c)
#define WERR_DS_ATTRIBUTE_OR_VALUE_EXISTS W_ERROR(0x200d)
#define WERR_DS_BUSY W_ERROR(0x200e)
#define WERR_DS_UNAVAILABLE W_ERROR(0x200f)
#define WERR_DS_NO_RIDS_ALLOCATED W_ERROR(0x2010)
#define WERR_DS_NO_MORE_RIDS W_ERROR(0x2011)
#define WERR_DS_INCORRECT_ROLE_OWNER W_ERROR(0x2012)
#define WERR_DS_RIDMGR_INIT_ERROR W_ERROR(0x2013)
#define WERR_DS_OBJ_CLASS_VIOLATION W_ERROR(0x2014)
#define WERR_DS_CANT_ON_NON_LEAF W_ERROR(0x2015)
#define WERR_DS_CANT_ON_RDN W_ERROR(0x2016)
#define WERR_DS_CANT_MOD_OBJ_CLASS W_ERROR(0x2017)
#define WERR_DS_CROSS_DOM_MOVE_ERROR W_ERROR(0x2018)
#define WERR_DS_GC_NOT_AVAILABLE W_ERROR(0x2019)
#define WERR_SHARED_POLICY W_ERROR(0x201a)
#define WERR_PO_NOT_INTERNAL W_ERROR(0x13c4)
#define WERR_CLUSTER_NODE_ALREADY_UP W_ERROR(0x13c5)
#define WERR_CLUSTER_NODE_ALREADY_DOWN W_ERROR(0x13c6)
#define WERR_CLUSTER_NETWORK_ALREADY_ONLINE W_ERROR(0x13c7)
#define WERR_CLUSTER_NETWORK_ALREADY_OFFLINE W_ERROR(0x13c8)
#define WERR_CLUSTER_NODE_ALREADY_MEMBER W_ERROR(0x13c9)
#define WERR_CLUSTER_LAST_INTERNAL_NETWORK W_ERROR(0x13ca)
#define WERR_CLUSTER_NETWORK_HAS_DEPENDENTS W_ERROR(0x13cb)
#define WERR_INVALID_OPERATION_ON_QUORUM W_ERROR(0x13cc)
#define WERR_DEPENDENCY_NOT_ALLOWED W_ERROR(0x13cd)
#define WERR_CLUSTER_NODE_PAUSED W_ERROR(0x13ce)
#define WERR_NODE_CANT_HOST_RESOURCE W_ERROR(0x13cf)
#define WERR_CLUSTER_NODE_NOT_READY W_ERROR(0x13d0)
#define WERR_CLUSTER_NODE_SHUTTING_DOWN W_ERROR(0x13d1)
#define WERR_CLUSTER_JOIN_ABORTED W_ERROR(0x13d2)
#define WERR_CLUSTER_INCOMPATIBLE_VERSIONS W_ERROR(0x13d3)
#define WERR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED W_ERROR(0x13d4)
#define WERR_CLUSTER_SYSTEM_CONFIG_CHANGED W_ERROR(0x13d5)
#define WERR_CLUSTER_RESOURCE_TYPE_NUTDOWN_IN_PROGRESS W_ERROR(0xfd8)
#define WERR_PEERDIST_ERROR_INVALIDATED W_ERROR(0xfd9)
#define WERR_PEERDIST_ERROR_ALREADY_EXISTS W_ERROR(0xfda)
#define WERR_PEERDIST_ERROR_OPERATION_NOTFOUND W_ERROR(0xfdb)
#define WERR_PEERDIST_ERROR_ALREADY_COMPLETED W_ERROR(0xfdc)
#define WERR_PEERDIST_ERROR_OUT_OF_BOUNDS W_ERROR(0xfdd)
#define WERR_PEERDIST_ERROR_VERSION_UNSUPPORTED W_ERROR(0xfde)
#define WERR_PEERDIST_ERROR_INVALID_CONFIGURATION W_ERROR(0xfdf)
#define WERR_PEERDIST_ERROR_NOT_LICENSED W_ERROR(0xfe0)
#define WERR_PEERDIST_ERROR_SERVICE_UNAVAILABLE W_ERROR(0xfe1)
#define WERR_DHCP_ADDRESS_CONFLICT W_ERROR(0x1004)
#define WERR_WMI_GUID_NOT_FOUND W_ERROR(0x1068)
#define WERR_WMI_INSTANCE_NOT_FOUND W_ERROR(0x1069)
#define WERR_WMI_ITEMID_NOT_FOUND W_ERROR(0x106a)
#define WERR_WMI_TRY_AGAIN W_ERROR(0x106b)
#define WERR_WMI_DP_NOT_FOUND W_ERROR(0x106c)
#define WERR_WMI_UNRESOLVED_INSTANCE_REF W_ERROR(0x106d)
#define WERR_WMI_ALREADY_ENABLED W_ERROR(0x106e)
#define WERR_WMI_GUID_DISCONNECTED W_ERROR(0x106f)
#dex8e3)
#define WERR_NERR_ALREADYEXISTS W_ERROR(0x8e4)
#define WERR_NERR_TOOMANYNAMES W_ERROR(0x8e5)
#define WERR_NERR_DELCOMPUTERNAME W_ERROR(0x8e6)
#define WERR_NERR_LOCALFORWARD W_ERROR(0x8e7)
#define WERR_NERR_GRPMSGPROCESSOR W_ERROR(0x8e8)
#define WERR_NERR_PAUSEDREMOTE W_ERROR(0x8e9)
#define WERR_NERR_BADRECEIVE W_ERROR(0x8ea)
#define WERR_NERR_NAMEINUSE W_ERROR(0x8eb)
#define WERR_NERR_MSGNOTSTARTED W_ERROR(0x8ec)
#define WERR_NERR_NOTLOCALNAME W_ERROR(0x8ed)
#define WERR_NERR_NOFORWARDNAME W_ERROR(0x8ee)
#define WERR_NERR_REMOTEFULL W_ERROR(0x8ef)
#define WERR_NERR_NAMENOTFORWARDED W_ERROR(0x8f0)
#define WERR_NERR_TRUNCATEDBROADCAST W_ERROR(0x8f1)
#define WERR_NERR_INVALIDDEVICE W_ERROR(0x8f6)
#define WERR_NERR_WRITEFAULT W_ERROR(0x8f7)
#define WERR_NERR_DUPLICATENAME W_ERROR(0x8f9)
#define WERR_NERR_DELETELATER W_ERROR(0x8fa)
#define WERR_NERR_INCOMPLETEDEL W_ERROR(0x8fb)
#define WERR_NERR_MULTIPLENETS W_ERROR(0x8fc)
#define WERR_NERR_NETNAMENOTFOUND W_ERROR(0x906)
#define WERR_NERR_DEVICENOTSHARED W_E_SIZE W_ERROR(0x76f)
#define WERR_ALREADY_WAITING W_ERROR(0x770)
#define WERR_PRINTER_DELETED W_ERROR(0x771)
#define WERR_INVALID_PRINTER_STATE W_ERROR(0x772)
#define WERR_PASSWORD_MUST_CHANGE W_ERROR(0x773)
#define WERR_DOMAIN_CONTROLLER_NOT_FOUND W_ERROR(0x774)
#define WERR_ACCOUNT_LOCKED_OUT W_ERROR(0x775)
#define WERR_OR_INVALID_OXID W_ERROR(0x776)
#define WERR_OR_INVALID_OID W_ERROR(0x777)
#define WERR_OR_INVALID_SET W_ERROR(0x778)
#define WERR_RPC_S_SEND_INCOMPLETE W_ERROR(0x779)
#define WERR_RPC_S_INVALID_ASYNC_HANDLE W_ERROR(0x77a)
#define WERR_RPC_S_INVALID_ASYNC_CALL W_ERROR(0x77b)
#define WERR_RPC_X_PIPE_CLOSED W_ERROR(0x77c)
#define WERR_RPC_X_PIPE_DISCIPLINE_ERROR W_ERROR(0x77d)
#define WERR_RPC_X_PIPE_EMPTY W_ERROR(0x77e)
#define WERR_NO_SITENAME W_ERROR(0x77f)
#define WERR_CANT_ACCESS_FILE W_ERROR(0x780)
#define WERR_CANT_RESOLVE_FILENAME W_ERROR(0x781)
#define WERR_RPC_S_ENTRY_TYPE_MISMATCH W_ERROR(0x782)
#define WERR_RPC_S_NOT_ALL_OBJS_EXPORTED W_ERROR(0x783)
#define WERR_RPC_S_INTERFACE_NOT_T_DISABLED W_ERROR(0x53e)
#define WERR_INVALID_ID_AUTHORITY W_ERROR(0x53f)
#define WERR_ALLOTTED_SPACE_EXCEEDED W_ERROR(0x540)
#define WERR_INVALID_GROUP_ATTRIBUTES W_ERROR(0x541)
#define WERR_BAD_IMPERSONATION_LEVEL W_ERROR(0x542)
#define WERR_CANT_OPEN_ANONYMOUS W_ERROR(0x543)
#define WERR_BAD_VALIDATION_CLASS W_ERROR(0x544)
#define WERR_BAD_TOKEN_TYPE W_ERROR(0x545)
#define WERR_NO_SECURITY_ON_OBJECT W_ERROR(0x546)
#define WERR_CANT_ACCESS_DOMAIN_INFO W_ERROR(0x547)
#define WERR_INVALID_SERVER_STATE W_ERROR(0x548)
#define WERR_INVALID_DOMAIN_STATE W_ERROR(0x549)
#define WERR_INVALID_DOMAIN_ROLE W_ERROR(0x54a)
#define WERR_NO_SUCH_DOMAIN W_ERROR(0x54b)
#define WERR_DOMAIN_EXISTS W_ERROR(0x54c)
#define WERR_DOMAIN_LIMIT_EXCEEDED W_ERROR(0x54d)
#define WERR_INTERNAL_DB_CORRUPTION W_ERROR(0x54e)
#define WERR_INTERNAL_ERROR W_ERROR(0x54f)
#define WERR_GENERIC_NOT_MAPPED W_ERROR(0x550)
#define WERR_BAD_DESCRIPTOR_FORMAT W_ERROR(0x551)
#define WERR_NOT_LOGON_PROCESS W_ERROR(0x552)
#define WERR_LOGON_SESSION_EXISTCE_NOT_ACTIVE W_ERROR(0x426)
#define WERR_FAILED_SERVICE_CONTROLLER_CONNECT W_ERROR(0x427)
#define WERR_EXCEPTION_IN_SERVICE W_ERROR(0x428)
#define WERR_DATABASE_DOES_NOT_EXIST W_ERROR(0x429)
#define WERR_SERVICE_SPECIFIC_ERROR W_ERROR(0x42a)
#define WERR_PROCESS_ABORTED W_ERROR(0x42b)
#define WERR_SERVICE_DEPENDENCY_FAIL W_ERROR(0x42c)
#define WERR_SERVICE_LOGON_FAILED W_ERROR(0x42d)
#define WERR_SERVICE_START_HANG W_ERROR(0x42e)
#define WERR_INVALID_SERVICE_LOCK W_ERROR(0x42f)
#define WERR_SERVICE_MARKED_FOR_DELETE W_ERROR(0x430)
#define WERR_SERVICE_EXISTS W_ERROR(0x431)
#define WERR_ALREADY_RUNNING_LKG W_ERROR(0x432)
#define WERR_SERVICE_DEPENDENCY_DELETED W_ERROR(0x433)
#define WERR_BOOT_ALREADY_ACCEPTED W_ERROR(0x434)
#define WERR_SERVICE_NEVER_STARTED W_ERROR(0x435)
#define WERR_DUPLICATE_SERVICE_NAME W_ERROR(0x436)
#define WERR_DIFFERENT_SERVICE_ACCOUNT W_ERROR(0x437)
#define WERR_CANNOT_DETECT_DRIVER_FAILURE W_ERROR(0x438)
#define WERR_CANNOT_DETECT_PROCESS_ABORT W_ERROR(0x439)
#define WERR_NO_RECOVEine WERR_UNDEFINED_CHARACTER W_ERROR(0x247)
#define WERR_FLOPPY_VOLUME W_ERROR(0x248)
#define WERR_BIOS_FAILED_TO_CONNECT_INTERRUPT W_ERROR(0x249)
#define WERR_BACKUP_CONTROLLER W_ERROR(0x24a)
#define WERR_MUTANT_LIMIT_EXCEEDED W_ERROR(0x24b)
#define WERR_FS_DRIVER_REQUIRED W_ERROR(0x24c)
#define WERR_CANNOT_LOAD_REGISTRY_FILE W_ERROR(0x24d)
#define WERR_DEBUG_ATTACH_FAILED W_ERROR(0x24e)
#define WERR_SYSTEM_PROCESS_TERMINATED W_ERROR(0x24f)
#define WERR_DATA_NOT_ACCEPTED W_ERROR(0x250)
#define WERR_VDM_HARD_ERROR W_ERROR(0x251)
#define WERR_DRIVER_CANCEL_TIMEOUT W_ERROR(0x252)
#define WERR_REPLY_MESSAGE_MISMATCH W_ERROR(0x253)
#define WERR_LOST_WRITEBEHIND_DATA W_ERROR(0x254)
#define WERR_CLIENT_SERVER_PARAMETERS_INVALID W_ERROR(0x255)
#define WERR_NOT_TINY_STREAM W_ERROR(0x256)
#define WERR_STACK_OVERFLOW_READ W_ERROR(0x257)
#define WERR_CONVERT_TO_LARGE W_ERROR(0x258)
#define WERR_FOUND_OUT_OF_SCOPE W_ERROR(0x259)
#define WERR_ALLOCATE_BUCKET W_ERROR(0x25a)
#define WERR_MARSHALL_OVERFLOW W_ERROR(0x25b)
#deefine WERR_NERR_SUCCESS W_ERROR(0x0)
#define WERR_INVALID_FUNCTION W_ERROR(0x1)
#define WERR_FILE_NOT_FOUND W_ERROR(0x2)
#define WERR_PATH_NOT_FOUND W_ERROR(0x3)
#define WERR_TOO_MANY_OPEN_FILES W_ERROR(0x4)
#define WERR_ACCESS_DENIED W_ERROR(0x5)
#define WERR_INVALID_HANDLE W_ERROR(0x6)
#define WERR_ARENA_TRASHED W_ERROR(0x7)
#define WERR_NOT_ENOUGH_MEMORY W_ERROR(0x8)
#define WERR_INVALID_BLOCK W_ERROR(0x9)
#define WERR_BAD_ENVIRONMENT W_ERROR(0xa)
#define WERR_BAD_FORMAT W_ERROR(0xb)
#define WERR_INVALID_ACCESS W_ERROR(0xc)
#define WERR_INVALID_DATA W_ERROR(0xd)
#define WERR_OUTOFMEMORY W_ERROR(0xe)
#define WERR_INVALID_DRIVE W_ERROR(0xf)
#define WERR_CURRENT_DIRECTORY W_ERROR(0x10)
#define WERR_NOT_SAME_DEVICE W_ERROR(0x11)
#define WERR_NO_MORE_FILES W_ERROR(0x12)
#define WERR_WRITE_PROTECT W_ERROR(0x13)
#define WERR_BAD_UNIT W_ERROR(0x14)
#define WERR_NOT_READY W_ERROR(0x15)
#define WERR_BAD_COMMAND W_ERROR(0x16)
#define WERR_CRC W_ERROR(0x17)
#define WERR_BAD_LENGTH W_ERROR(0x18)
#define WERR_SEEK W_ERR_PKT_ALTER)] */
	struct dcerpc_bind_ack alter_resp;/* [case(DCERPC_PKT_ALTER_RESP)] */
	struct dcerpc_shutdown shutdown;/* [case(DCERPC_PKT_SHUTDOWN)] */
	struct dcerpc_co_cancel co_cancel;/* [case(DCERPC_PKT_CO_CANCEL)] */
	struct dcerpc_orphaned orphaned;/* [case(DCERPC_PKT_ORPHANED)] */
	struct dcerpc_auth3 auth3;/* [case(DCERPC_PKT_AUTH3)] */
	struct dcerpc_rts rts;/* [case(DCERPC_PKT_RTS)] */
}/* [nodiscriminant,public] */;

/* bitmap dcerpc_pfc_flags */
#define DCERPC_PFC_FLAG_FIRST ( 0x01 )
#define DCERPC_PFC_FLAG_LAST ( 0x02 )
#define DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING ( 0x04 )
#define DCERPC_PFC_FLAG_CONC_MPX ( 0x10 )
#define DCERPC_PFC_FLAG_DID_NOT_EXECUTE ( 0x20 )
#define DCERPC_PFC_FLAG_MAYBE ( 0x40 )
#define DCERPC_PFC_FLAG_OBJECT_UUID ( 0x80 )

struct ncacn_packet {
	uint8_t rpc_vers;
	uint8_t rpc_vers_minor;
	enum dcerpc_pkt_type ptype;
	uint8_t pfc_flags;
	uint8_t drep[4];
	uint16_t frag_length;
	uint16_t auth_length;
	uint32_t call_id;
	union dcerpc_payload u;/* [switch_is(ptype)] CLIENT_STUB ( 0x1C000025 )
#define DCERPC_FAULT_ACCESS_DENIED ( 0x00000005 )
#define DCERPC_FAULT_SERVER_UNAVAILABLE ( 0x000006ba )
#define DCERPC_FAULT_NO_CALL_ACTIVE ( 0x000006bd )
#define DCERPC_FAULT_CANT_PERFORM ( 0x000006d8 )
#define DCERPC_FAULT_OUT_OF_RESOURCES ( 0x000006d9 )
#define DCERPC_FAULT_BAD_STUB_DATA ( 0x000006f7 )
#define DCERPC_FAULT_SEC_PKG_ERROR ( 0x00000721 )
#endif
;

/* bitmap dcerpc_fault_flags */
#define DCERPC_FAULT_FLAG_EXTENDED_ERROR_INFORMATION ( 0x01 )

struct dcerpc_fault {
	uint32_t alloc_hint;
	uint16_t context_id;
	uint8_t cancel_count;
	uint8_t flags;
	enum dcerpc_nca_status status;
	uint32_t reserved;/* [value(0)] */
	DATA_BLOB error_and_verifier;/* [flag(LIBNDR_FLAG_REMAINING)] */
};

enum dcerpc_AuthType
#ifndef USE_UINT_ENUMS
 {
	DCERPC_AUTH_TYPE_NONE=(int)(0),
	DCERPC_AUTH_TYPE_KRB5_1=(int)(1),
	DCERPC_AUTH_TYPE_SPNEGO=(int)(9),
	DCERPC_AUTH_TYPE_NTLMSSP=(int)(10),
	DCERPC_AUTH_TYPE_KRB5=(int)(16),
	DCERPC_AUTH_TYPE_DPA=(int)(17),
	DCERPC_AUTH_TYPE_MSN=(int)(18),
	DCE_ACK_RESULT_PROVIDER_REJECTION )
#define DCERPC_BIND_REASON_ASYNTAX	( DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED )
#define DECRPC_BIND_PROTOCOL_VERSION_NOT_SUPPORTED	( DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED )
#define DCERPC_BIND_REASON_INVALID_AUTH_TYPE	( DCERPC_BIND_NAK_REASON_INVALID_AUTH_TYPE )
#define DCERPC_RESPONSE_LENGTH	( 24 )
#define DCERPC_FAULT_OP_RNG_ERROR	( DCERPC_NCA_S_OP_RNG_ERROR )
#define DCERPC_FAULT_NDR	( DCERPC_FAULT_BAD_STUB_DATA )
#define DCERPC_FAULT_INVALID_TAG	( DCERPC_NCA_S_FAULT_INVALID_TAG )
#define DCERPC_FAULT_CONTEXT_MISMATCH	( DCERPC_NCA_S_FAULT_CONTEXT_MISMATCH )
#define DCERPC_FAULT_OTHER	( 0x00000001 )
#define DCERPC_FAULT_TODO	( 0x00000042 )
#define DCERPC_FAULT_LENGTH	( 32 )
#define AS_SYSTEM_MAGIC_PATH_TOKEN	( "/root/ncalrpc_as_system" )
#define DCERPC_AUTH_TRAILER_LENGTH	( 8 )
#define DCERPC_AUTH_PAD_ALIGNMENT	( 16 )
#define DCERPC_PFC_FLAG_PENDING_CANCEL	( DCERPC_PFC_FLAG_PENDING_CANCEL_OR_HDR_SIGNING )
#define DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGn_t fn);
_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob_noalloc(const uint8_t *buf,
							size_t buflen,
							void *p,
							ndr_pull_flags_fn_t fn,
							size_t *consumed);
enum ndr_err_code ndr_pull_struct_blob_all_noalloc(const DATA_BLOB *blob,
						   void *p, ndr_pull_flags_fn_t fn);
enum ndr_err_code ndr_pull_union_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_pull_flags_fn_t fn);
enum ndr_err_code ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_pull_flags_fn_t fn);

enum ndr_err_code _ndr_deepcopy_struct(ndr_push_flags_fn_t push_fn,
				       const void *src,
				       ndr_pull_flags_fn_t pull_fn,
				       TALLOC_CTX *dst_mem, void *dst);
#define ndr_deepcopy_struct(type, src, dst_mem, dst) \
	_ndr_deepcopy_struct((ndr_push_flags_fn_t)ndr_push_ ## type, \
			     src, \
			     (ndr_pull_flags_fn_t)ndr_pull_ ## type, \
			     dst_mem, dst)

/* from libndr_basic.h */
#define NDR_SCALAR_PROTO(name, type) \
enum ntax_id_buf { char buf[39 /*GUID*/ + 3 /* "/0x" */ + 8]; };
char *ndr_syntax_id_buf_string(
	const struct ndr_syntax_id *id, struct ndr_syntax_id_buf *buf);
char *ndr_syntax_id_to_string(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *id);

bool ndr_syntax_id_from_string(const char *s, struct ndr_syntax_id *id);
enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p, ndr_push_flags_fn_t fn);
enum ndr_err_code ndr_push_struct_into_fixed_blob(DATA_BLOB *blob,
						  const void *p,
						  ndr_push_flags_fn_t fn);
enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p, uint32_t level, ndr_push_flags_fn_t fn);
size_t ndr_size_struct(const void *p, libndr_flags flags, ndr_push_flags_fn_t push);
size_t ndr_size_union(const void *p, libndr_flags flags, uint32_t level, ndr_push_flags_fn_t push);
uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr);
void ndr_push_restore_relative_base_offset(struct ndr_push *ndr, uint32_t offset);
enumne NDR_PUSH_CHECK_FN_FLAGS(ndr, flags) do { \
	if ((flags) & ~(NDR_BOTH|NDR_SET_VALUES)) \
		return ndr_push_error(ndr, NDR_ERR_FLAGS, "Invalid fn push flags 0x%"PRI_NDR_FLAGS_TYPE, flags); \
} while (0)

#define NDR_PULL_NEED_BYTES(ndr, n) do { \
	if (unlikely(\
		(n) > ndr->data_size || \
		ndr->offset + (n) > ndr->data_size || \
		ndr->offset + (n) < ndr->offset)) { \
		if (ndr->flags & LIBNDR_FLAG_INCOMPLETE_BUFFER) { \
			uint32_t _available = ndr->data_size - ndr->offset; \
			uint32_t _missing = n - _available; \
			ndr->relative_highest_offset = _missing; \
		} \
		return ndr_pull_error(ndr, NDR_ERR_BUFSIZE, "Pull bytes %zu (%s)", (size_t)n, __location__); \
	} \
} while(0)

#define NDR_ALIGN(ndr, n) ndr_align_size(ndr->offset, n)

#define NDR_ROUND(size, n) (((size)+((n)-1)) & ~((n)-1))

#define NDR_PULL_ALIGN(ndr, n) do { \
	if (unlikely(!(ndr->flags & LIBNDR_FLAG_NOALIGN))) {	\
		if (unlikely(ndr->flags & LIBNDR_FLAG_PAD_CHECK)) {	\
			ndr_check_padding(ndr, n); \
		} \
		if(unlikely( \
			((ndr->or_token_list {
	struct ndr_token *tokens;
	uint32_t count;
};

struct ndr_compression_state;

#define LIBNDR_STATIC_ASSERT(msg, cond) \
	typedef char static_assert_##msg[(cond) ? 1 : -1]

/*
 * If youâ€™re considering changing the size of this type, see also
 * $scalar_alignment in pidl/lib/Parse/Pidl/NDR.pm.
 */
typedef enum {
	LIBNDR_FLAG_BIGENDIAN = 1U << 0,
	LIBNDR_FLAG_NOALIGN = 1U << 1,

	LIBNDR_FLAG_STR_ASCII = 1U << 2,
	LIBNDR_FLAG_STR_LEN4 = 1U << 3,
	LIBNDR_FLAG_STR_SIZE4 = 1U << 4,
	LIBNDR_FLAG_STR_NOTERM = 1U << 5,
	LIBNDR_FLAG_STR_NULLTERM = 1U << 6,
	LIBNDR_FLAG_STR_SIZE2 = 1U << 7,
	LIBNDR_FLAG_STR_BYTESIZE = 1U << 8,
	LIBNDR_FLAG_STR_NO_EMBEDDED_NUL = 1U << 9,
	LIBNDR_FLAG_STR_CONFORMANT = 1U << 10,
	LIBNDR_FLAG_STR_CHARLEN = 1U << 11,
	LIBNDR_FLAG_STR_UTF8 = 1U << 12,
	LIBNDR_FLAG_STR_RAW8 = 1U << 13,

	/*
	 * Mark an element as SECRET, it won't be printed via
	 * ndr_print* unless NDR_PRINT_SECRETS is specified.
	 */
	LIBNDR_FLAG_IS_SECRET = 1U << 14,

	/* Disable string token compression  *NDR_FLAG_ALIGN2),relative] */
	uint32_t unknown1;
	const char * dns_name2;/* [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2),relative] */
	uint64_t unknown2;
}/* [gensize,public,relative_base] */;

struct repsFromTo2 {
	uint32_t blobsize;/* [value(ndr_size_repsFromTo2(this,ndr->flags)+8)] */
	uint32_t consecutive_sync_failures;
	NTTIME last_success;
	NTTIME last_attempt;
	WERROR result_last_attempt;
	struct repsFromTo2OtherInfo *other_info;/* [relative] */
	uint32_t other_info_length;/* [value(ndr_size_repsFromTo2OtherInfo(other_info,ndr->flags))] */
	uint32_t replica_flags;
	uint8_t schedule[84];
	uint32_t reserved;/* [value(0)] */
	struct drsuapi_DsReplicaHighWaterMark highwatermark;
	struct GUID source_dsa_obj_guid;
	struct GUID source_dsa_invocation_id;
	struct GUID transport_guid;
	uint64_t unknown1;
}/* [flag(LIBNDR_PRINT_ARRAY_HEX),gensize,public] */;

union repsFromTo {
	struct repsFromTo1 ctr1;/* [case] */
	struct repsFromTo2 ctr2;/* [case(2)] */
}/* [nodiscriminant] */;

struct repsFromToBlob {
	s,
								  unsigned int flags);
bool ldb_wrap_add(const char *url, struct tevent_context *ev,
				  struct loadparm_context *lp_ctx,
				  struct auth_session_info *session_info,
				  struct cli_credentials *credentials,
				  unsigned int flags,
				  struct ldb_context *ldb);
char *ldb_relative_path(struct ldb_context *ldb,
				 TALLOC_CTX *mem_ctx,
				 const char *name);

int samba_ldb_connect(struct ldb_context *ldb, struct loadparm_context *lp_ctx,
		      const char *url, unsigned int flags);

#endif /* _LDB_WRAP_H_ */
/* header auto-generated by pidl */

#ifndef _PIDL_HEADER_drsblobs
#define _PIDL_HEADER_drsblobs

#include <stdint.h>


#include <gen_ndr/drsuapi.h>
#include <gen_ndr/misc.h>
#include <gen_ndr/samr.h>
#include <gen_ndr/lsa.h>
#include <gen_ndr/security.h>
#ifndef _HEADER_drsblobs
#define _HEADER_drsblobs

#define SUPPLEMENTAL_CREDENTIALS_PREFIX	( "                                                " )
#define ENCRYPTED_SECRET_MAGIC_VALUE	( 0xCA5CADED )
struct replPropertyMetaData1 {
	enu */,
				 uint32_t *total_entries /* [out] [ref] */,
				 uint32_t *resume_handle /* [in,out] [ref] */);

/************************************************************//**
 *
 * NetLocalGroupAddMembers
 *
 * @brief Add Members to a Local Group
 *
 * @param[in] server_name The server name to connect to
 * @param[in] group_name The name of the group that is going to modified
 * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
 * @param[in] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X structure
 * @param[in] total_entries The number of LOCALGROUP_MEMBERS_INFO_X entries in
 * the buffer
 * @return NET_API_STATUS
 *
 * example localgroup/localgroup_addmembers.c
 ***************************************************************/

NET_API_STATUS NetLocalGroupAddMembers(const char * server_name /* [in] */,
				       const char * group_name /* [in] */,
				       uint32_t level /* [in] */,
				       uint8_t *buffer /* [in] [ref] */,
				       uint32_t total_entries /* [in] */);
e of the group that is going to be modified
 * @param[in] level The level defining the structure type in buf
 * @param[in] buf The buffer containing a GROUP_INFO_X structure
 * @param[out] parm_err The returned parameter error number if any
 * @return NET_API_STATUS
 *
 * example group/group_setinfo.c
 ***************************************************************/

NET_API_STATUS NetGroupSetInfo(const char * server_name /* [in] */,
			       const char * group_name /* [in] */,
			       uint32_t level /* [in] */,
			       uint8_t *buf /* [in] [ref] */,
			       uint32_t *parm_err /* [out] [ref] */);

/************************************************************//**
 *
 * NetGroupGetInfo
 *
 * @brief Get Domain Group Information
 *
 * @param[in] server_name The server name to connect to
 * @param[in] group_name The name of the group that is going to be queried
 * @param[in] level The level defining the requested GROUP_INFO_X structure
 * @param[out] buf The buffer containing a GROUP_INFO_X structure
 * @re
 * NetUserEnum
 *
 * @brief Enumerate accounts on a server
 *
 * @param[in] server_name The server name to connect to
 * @param[in] level The enumeration level used for the query (Currently only
 * level 0 is supported)
 * @param[in] filter The account flags filter used for the query
 * @param[out] buffer The returned enumeration buffer
 * @param[in] prefmaxlen The requested maximal buffer size
 * @param[out] entries_read The number of returned entries
 * @param[out] total_entries The number of total entries
 * @param[in,out] resume_handle A handle passed in and returned for resuming
 * operations
 * @return NET_API_STATUS
 *
 * example user/user_enum.c
 ***************************************************************/

NET_API_STATUS NetUserEnum(const char * server_name /* [in] */,
			   uint32_t level /* [in] */,
			   uint32_t filter /* [in] */,
			   uint8_t **buffer /* [out] [ref] */,
			   uint32_t prefmaxlen /* [in] */,
			   uint32_t *entries_read /* [out] [ref] */,
			   uint32_t *total_entries /* [o *name_buffer /* [out] [ref] */,
				     uint16_t *name_type /* [out] [ref] */);

/************************************************************//**
 *
 * NetGetJoinableOUs
 *
 * @brief Query for the list of joinable organizational Units that can be used
 * for joining AD
 *
 * @param[in] server_name The server name to connect to
 * @param[in] domain The AD domain to query
 * @param[in] account The domain account used for the query
 * @param[in] password The domain account's password used for the query
 * @param[out] ou_count The number of ous returned
 * @param[out] ous Returned string array containing the ous
 * @return NET_API_STATUS
 *
 * example netdomjoin-gui/netdomjoin-gui.c
 *
 ***************************************************************/

NET_API_STATUS NetGetJoinableOUs(const char * server_name /* [in] */,
				 const char * domain /* [in] [ref] */,
				 const char * account /* [in] */,
				 const char * password /* [in] */,
				 uint32_t *ou_count /* [out] [ref] */,
				 const char * **ous /* [oune DS_PDC_REQUIRED ( 0x00000080 )
#define DS_BACKGROUND_ONLY ( 0x00000100 )
#define DS_IP_REQUIRED ( 0x00000200 )
#define DS_KDC_REQUIRED ( 0x00000400 )
#define DS_TIMESERV_REQUIRED ( 0x00000800 )
#define DS_WRITABLE_REQUIRED ( 0x00001000 )
#define DS_GOOD_TIMESERV_PREFERRED ( 0x00002000 )
#define DS_AVOID_SELF ( 0x00004000 )
#define DS_ONLY_LDAP_NEEDED ( 0x00008000 )
#define DS_IS_FLAT_NAME ( 0x00010000 )
#define DS_IS_DNS_NAME ( 0x00020000 )
#define DS_TRY_NEXTCLOSEST_SITE ( 0x00040000 )
#define DS_DIRECTORY_SERVICE_6_REQUIRED ( 0x00080000 )
#define DS_WEB_SERVICE_REQUIRED ( 0x00100000 )
#define DS_RETURN_DNS_NAME ( 0x40000000 )
#define DS_RETURN_FLAT_NAME ( 0x80000000 )

#endif /* _HEADER_netlogon */

/****************************************************************
****************************************************************/

struct libnetapi_ctx;

/****************************************************************
****************************************************************/

NET_API_STATUS libnet6 {
	uint32_t sv1596_ConnectionNoSessionsTimeout;
};

struct SERVER_INFO_1597 {
	uint32_t sv1597_IdleThreadTimeOut;
};

struct SERVER_INFO_1598 {
	uint32_t sv1598_enableW9xsecuritysignature;
};

struct SERVER_INFO_1599 {
	uint8_t sv1598_enforcekerberosreauthentication;
};

struct SERVER_INFO_1600 {
	uint8_t sv1598_disabledos;
};

struct SERVER_INFO_1601 {
	uint32_t sv1598_lowdiskspaceminimum;
};

struct SERVER_INFO_1602 {
	uint8_t sv_1598_disablestrictnamechecking;
};

struct USER_INFO_0 {
	const char * usri0_name;
};

#define USER_PRIV_GUEST	( 0 )
#define USER_PRIV_USER	( 1 )
#define USER_PRIV_ADMIN	( 2 )

struct USER_INFO_1 {
	const char * usri1_name;
	const char * usri1_password;
	uint32_t usri1_password_age;
	uint32_t usri1_priv;
	const char * usri1_home_dir;
	const char * usri1_comment;
	uint32_t usri1_flags;
	const char * usri1_script_path;
};

#define AF_OP_PRINT	( 0x1 )
#define AF_OP_COMM	( 0x2 )
#define AF_OP_SERVER	( 0x4 )
#define AF_OP_ACCOUNTS	( 0x8 )

struct USER_INFO_2 {
	const char * usri2_namev503_xactmemsize;
	uint32_t sv503_threadpriority;
	uint32_t sv503_maxmpxct;
	uint32_t sv503_oplockbreakwait;
	uint32_t sv503_oplockbreakresponsewait;
	uint8_t sv503_enableoplocks;
	uint8_t sv503_enableoplockforceclose;
	uint8_t sv503_enablefcbopens;
	uint8_t sv503_enableraw;
	uint8_t sv503_enablesharednetdrives;
	uint32_t sv503_minfreeconnections;
	uint32_t sv503_maxfreeconnections;
};

struct SERVER_INFO_599 {
	uint32_t sv599_sessopens;
	uint32_t sv599_sessvcs;
	uint32_t sv599_opensearch;
	uint32_t sv599_sizreqbuf;
	uint32_t sv599_initworkitems;
	uint32_t sv599_maxworkitems;
	uint32_t sv599_rawworkitems;
	uint32_t sv599_irpstacksize;
	uint32_t sv599_maxrawbuflen;
	uint32_t sv599_sessusers;
	uint32_t sv599_sessconns;
	uint32_t sv599_maxpagedmemoryusage;
	uint32_t sv599_maxnonpagedmemoryusage;
	uint8_t sv599_enablesoftcompat;
	uint8_t sv599_enableforcedlogoff;
	uint8_t sv599_timesource;
	uint8_t sv599_acceptdownlevelapis;
	uint8_t sv599_lmannounce;
	const char * sv599_domain;
	uint32_t sv599_maxcopyreadlen;
	ugoto done;\
	}\
} while (0)

#define W_ERROR_NOT_OK_GOTO(x, y) do {\
	if (!W_ERROR_IS_OK(x)) {\
		goto y;\
	}\
} while(0)

/* these are win32 error codes. There are only a few places where
   these matter for Samba, primarily in the NT printing code */
#define WERR_OK W_ERROR(0x00000000)
#define WERR_STATUS_MORE_ENTRIES W_ERROR(0x00000105)

#define WERR_MULTIPLE_FAULT_VIOLATION   W_ERROR(0x00000280)
#define WERR_SERVICE_NOTIFICATION       W_ERROR(0x000002CC)
#define WERR_LOG_HARD_ERROR     W_ERROR(0x000002CE)
#define WERR_WAIT_1     W_ERROR(0x000002DB)
#define WERR_WAIT_2     W_ERROR(0x000002DC)
#define WERR_WAIT_3     W_ERROR(0x000002DD)
#define WERR_WAIT_63    W_ERROR(0x000002DE)
#define WERR_ABANDONED_WAIT_63  W_ERROR(0x000002E0)
#define WERR_USER_APC   W_ERROR(0x000002E1)
#define WERR_KERNEL_APC W_ERROR(0x000002E2)
#define WERR_ALERTED    W_ERROR(0x000002E3)
#define WERR_INVALID_PRIMARY_GROUP      W_ERROR(0x0000051C)

#define WERR_DS_DRA_SECRETS_DENIED			W_ERROR(0x000021B6)

#define WERR_DNS_ERROR_KEYMAST *bind_handle;/* [ref] */
		struct drsuapi_DsBindInfoCtr *bind_info;/* [unique] */
		WERROR result;
	} out;

};


struct drsuapi_DsUnbind {
	struct {
		struct policy_handle *bind_handle;/* [ref] */
	} in;

	struct {
		struct policy_handle *bind_handle;/* [ref] */
		WERROR result;
	} out;

};


struct drsuapi_DsReplicaSync {
	struct {
		struct policy_handle *bind_handle;/* [ref] */
		uint32_t level;
		union drsuapi_DsReplicaSyncRequest *req;/* [ref,switch_is(level)] */
	} in;

	struct {
		WERROR result;
	} out;

};


struct drsuapi_DsGetNCChanges {
	struct {
		struct policy_handle *bind_handle;/* [ref] */
		uint32_t level;
		union drsuapi_DsGetNCChangesRequest *req;/* [ref,switch_is(level)] */
	} in;

	struct {
		uint32_t *level_out;/* [ref] */
		union drsuapi_DsGetNCChangesCtr *ctr;/* [ref,switch_is(*level_out)] */
		WERROR result;
	} out;

};


struct drsuapi_DsReplicaUpdateRefs {
	struct {
		struct policy_handle *bind_handle;/* [ref] */
		uint32_t level;
		union drsuapi_DsReplicaUpdateRefsRequest req;/* [sw{
	uint32_t count;/* [range(0,10000)] */
	struct drsuapi_DsGetDCConnection01 *array;/* [size_is(count),unique] */
};

union drsuapi_DsGetDCInfoCtr {
	struct drsuapi_DsGetDCInfoCtr1 ctr1;/* [case(DRSUAPI_DC_INFO_CTR_1)] */
	struct drsuapi_DsGetDCInfoCtr2 ctr2;/* [case(DRSUAPI_DC_INFO_CTR_2)] */
	struct drsuapi_DsGetDCInfoCtr3 ctr3;/* [case(DRSUAPI_DC_INFO_CTR_3)] */
	struct drsuapi_DsGetDCConnectionCtr01 ctr01;/* [case(DRSUAPI_DC_CONNECTION_CTR_01)] */
}/* [switch_type(drsuapi_DsGetDCInfoCtrLevels)] */;

struct drsuapi_DsReplicaObjectListItem {
	struct drsuapi_DsReplicaObjectListItem *next_object;/* [max_recursion(20000),unique] */
	struct drsuapi_DsReplicaObject object;
}/* [noprint,public] */;

enum drsuapi_DsAddEntry_DirErr
#ifndef USE_UINT_ENUMS
 {
	DRSUAPI_DIRERR_OK=(int)(0),
	DRSUAPI_DIRERR_ATTRIBUTE=(int)(1),
	DRSUAPI_DIRERR_NAME=(int)(2),
	DRSUAPI_DIRERR_REFERRAL=(int)(3),
	DRSUAPI_DIRERR_SECURITY=(int)(4),
	DRSUAPI_DIRERR_SERVICE=(int)(5),
	DRSUAPI_DIRERR_UPDATE=(int)(6),
	DRSUAPI_DIRERR_SYSTEM=(int)(DRSUAPI_DS_NAME_FORMAT_STRING_SID_NAME ( 0xFFFFFFF4 )
#define DRSUAPI_DS_NAME_FORMAT_ALT_SECURITY_IDENTITIES_NAME ( 0xFFFFFFF5 )
#define DRSUAPI_DS_NAME_FORMAT_LIST_NCS ( 0xFFFFFFF6 )
#define DRSUAPI_DS_NAME_FORMAT_LIST_DOMAINS ( 0xFFFFFFF7 )
#define DRSUAPI_DS_NAME_FORMAT_MAP_SCHEMA_GUID ( 0xFFFFFFF8 )
#define DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT_NAME_SANS_DOMAIN ( 0xFFFFFFF9 )
#define DRSUAPI_DS_NAME_FORMAT_LIST_ROLES ( 0xFFFFFFFA )
#define DRSUAPI_DS_NAME_FORMAT_LIST_INFO_FOR_SERVER ( 0xFFFFFFFB )
#define DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_FOR_DOMAIN_IN_SITE ( 0xFFFFFFFC )
#define DRSUAPI_DS_NAME_FORMAT_LIST_DOMAINS_IN_SITE ( 0xFFFFFFFD )
#define DRSUAPI_DS_NAME_FORMAT_LIST_SERVERS_IN_SITE ( 0xFFFFFFFE )
#define DRSUAPI_DS_NAME_FORMAT_LIST_SITES ( 0xFFFFFFFF )
#endif
;

struct drsuapi_DsNameString {
	const char *str;/* [charset(UTF16),unique] */
};

struct drsuapi_DsNameRequest1 {
	uint32_t codepage;
	uint32_t language;
	enum drsuapi_DsNameFlags format_flags;
	enum drsuapi_DsNameFormat format_offered;
	enumr_size_dn;/* [value(strlen_m(dn))] */
	const char *dn;/* [charset(UTF16)] */
	uint32_t __ndr_size_binary;/* [value(binary.length+4)] */
	DATA_BLOB binary;/* [flag(LIBNDR_FLAG_REMAINING)] */
}/* [public] */;

struct drsuapi_DsReplicaAttribute {
	enum drsuapi_DsAttributeId attid;
	struct drsuapi_DsAttributeValueCtr value_ctr;
}/* [noprint,public] */;

struct drsuapi_DsReplicaAttributeCtr {
	uint32_t num_attributes;/* [range(0,1048576)] */
	struct drsuapi_DsReplicaAttribute *attributes;/* [size_is(num_attributes),unique] */
};

/* bitmap drsuapi_DsReplicaObjectFlags */
#define DRSUAPI_DS_REPLICA_OBJECT_FROM_MASTER ( 0x00000001 )
#define DRSUAPI_DS_REPLICA_OBJECT_DYNAMIC ( 0x00000002 )
#define DRSUAPI_DS_REPLICA_OBJECT_REMOTE_MODIFY ( 0x00010000 )

struct drsuapi_DsReplicaObject {
	struct drsuapi_DsReplicaObjectIdentifier *identifier;/* [unique] */
	uint32_t flags;
	struct drsuapi_DsReplicaAttributeCtr attribute_ctr;
}/* [public] */;

struct drsuapi_DsReplicaMetaData {
	uint32_t version;
	NTTIME originating_changTTID_msDS_SupportedEncryptionTypes=(int)(0x000907ab),
	DRSUAPI_ATTID_msDS_HostServiceAccount=(int)(0x00090808),
	DRSUAPI_ATTID_isRecycled=(int)(0x0009080a),
	DRSUAPI_ATTID_INVALID=(int)(0xFFFFFFFF)
}
#else
 { __do_not_use_enum_drsuapi_DsAttributeId=INT_MAX}
#define DRSUAPI_ATTID_objectClass ( 0x00000000 )
#define DRSUAPI_ATTID_cn ( 0x00000003 )
#define DRSUAPI_ATTID_ou ( 0x0000000b )
#define DRSUAPI_ATTID_description ( 0x0000000d )
#define DRSUAPI_ATTID_member ( 0x0000001f )
#define DRSUAPI_ATTID_distinguishedName ( 0x00000031 )
#define DRSUAPI_ATTID_instanceType ( 0x00020001 )
#define DRSUAPI_ATTID_whenCreated ( 0x00020002 )
#define DRSUAPI_ATTID_possSuperiors ( 0x00020008 )
#define DRSUAPI_ATTID_displayName ( 0x0002000d )
#define DRSUAPI_ATTID_hasMasterNCs ( 0x0002000e )
#define DRSUAPI_ATTID_nCName ( 0x00020010 )
#define DRSUAPI_ATTID_subClassOf ( 0x00020015 )
#define DRSUAPI_ATTID_governsID ( 0x00020016 )
#define DRSUAPI_ATTID_mustContain ( 0x00020018 )
#define DRSUAPI_ATTID_mayContain ( 0x00020019 )
#defObjectIdentifier *naming_context;/* [ref] */
	struct GUID source_dsa_guid;
	const char *source_dsa_dns;/* [charset(DOS),unique] */
	uint32_t options;
};

union drsuapi_DsReplicaSyncRequest {
	struct drsuapi_DsReplicaSyncRequest1 req1;/* [case] */
}/* [switch_type(uint32)] */;

struct drsuapi_DsReplicaHighWaterMark {
	uint64_t tmp_highest_usn;
	uint64_t reserved_usn;
	uint64_t highest_usn;
}/* [public] */;

struct drsuapi_DsReplicaCursor {
	struct GUID source_dsa_invocation_id;
	uint64_t highest_usn;
}/* [public] */;

struct drsuapi_DsReplicaCursorCtrEx {
	uint32_t version;/* [value] */
	uint32_t reserved1;/* [value(0)] */
	uint32_t count;/* [range(0,0x100000)] */
	uint32_t reserved2;/* [value(0)] */
	struct drsuapi_DsReplicaCursor *cursors;/* [size_is(count)] */
};

enum drsuapi_DsExtendedOperation
#ifndef USE_UINT_ENUMS
 {
	DRSUAPI_EXOP_NONE=(int)(0x00000000),
	DRSUAPI_EXOP_FSMO_REQ_ROLE=(int)(0x00000001),
	DRSUAPI_EXOP_FSMO_RID_ALLOC=(int)(0x00000002),
	DRSUAPI_EXOP_FSMO_RID_REQ_ROLE=(int)(0x00000003),
	DRSine DRSUAPI_DRS_NO_DISCARD ( 0x00100000 )
#define DRSUAPI_DRS_NEVER_SYNCED ( 0x00200000 )
#define DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING ( 0x00400000 )
#define DRSUAPI_DRS_INIT_SYNC_NOW ( 0x00800000 )
#define DRSUAPI_DRS_PREEMPTED ( 0x01000000 )
#define DRSUAPI_DRS_SYNC_FORCED ( 0x02000000 )
#define DRSUAPI_DRS_DISABLE_AUTO_SYNC ( 0x04000000 )
#define DRSUAPI_DRS_DISABLE_PERIODIC_SYNC ( 0x08000000 )
#define DRSUAPI_DRS_USE_COMPRESSION ( 0x10000000 )
#define DRSUAPI_DRS_NEVER_NOTIFY ( 0x20000000 )
#define DRSUAPI_DRS_SYNC_PAS ( 0x40000000 )
#define DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP ( 0x80000000 )

/* bitmap drsuapi_DrsMoreOptions */
#define DRSUAPI_DRS_GET_TGT ( 0x00000001 )

/* bitmap drsuapi_DrsUpdate */
#define DRSUAPI_DRS_UPDATE_FLAGS ( 0x00000001 )
#define DRSUAPI_DRS_UPDATE_ADDRESS ( 0x00000002 )
#define DRSUAPI_DRS_UPDATE_SCHEDULE ( 0x00000004 )

/* bitmap drsuapi_SupportedExtensions */
#define DRSUAPI_SUPPORTED_EXTENSION_BASE ( 0x00000001 )
#define DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION ( 0x00
*/

/* This is a public header file that is installed as part of Samba.
 * If you remove any functions or change their signature, update
 * the so version number. */

#ifndef _SAMBA_DATABLOB_H_
#define _SAMBA_DATABLOB_H_

#ifndef _PUBLIC_
#define _PUBLIC_
#endif

#include <talloc.h>
#include <stdbool.h>
#include <stdint.h>

/* used to hold an arbitrary blob of data */
typedef struct datablob {
	uint8_t *data;
	size_t length;
} DATA_BLOB;

/* by making struct ldb_val and DATA_BLOB the same, we can simplify
   a fair bit of code */
#define ldb_val datablob

#define data_blob(ptr, size) data_blob_named(ptr, size, "DATA_BLOB: " __location__)
#define data_blob_talloc(ctx, ptr, size) data_blob_talloc_named(ctx, ptr, size, "DATA_BLOB: " __location__)
#define data_blob_dup_talloc(ctx, blob) data_blob_talloc_named(ctx, (blob).data, (blob).length, "DATA_BLOB: " __location__)

/**
 construct a data blob, must be freed with data_blob_free()
 you can pass NULL for p and get a blank data blob
**/
_PUBLIC_ DATA_BLOB data_b struct drsuapi_DsGetDCConnection01 *r);
void ndr_print_drsuapi_DsGetDCConnectionCtr01(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetDCConnectionCtr01 *r);
void ndr_print_drsuapi_DsGetDCInfoCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetDCInfoCtr *r);
enum ndr_err_code ndr_push_drsuapi_DsReplicaObjectListItem(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct drsuapi_DsReplicaObjectListItem *r);
enum ndr_err_code ndr_pull_drsuapi_DsReplicaObjectListItem(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct drsuapi_DsReplicaObjectListItem *r);
void ndr_print_drsuapi_DsReplicaObjectListItem(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaObjectListItem *r);
void ndr_print_drsuapi_DsAddEntry_DirErr(struct ndr_print *ndr, const char *name, enum drsuapi_DsAddEntry_DirErr r);
void ndr_print_drsuapi_DsAddEntryRequest2(struct ndr_print *ndr, const char *name, const struct drsuapi_DsAddEntryRequest2 *r);
void ndr_print_drsuapi_SecBufferType(t char *name, const union drsuapi_DsReplicaDelRequest *r);
void ndr_print_drsuapi_DsReplicaModRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaModRequest1 *r);
void ndr_print_drsuapi_DsReplicaModRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsReplicaModRequest *r);
void ndr_print_drsuapi_DsMembershipType(struct ndr_print *ndr, const char *name, enum drsuapi_DsMembershipType r);
void ndr_print_drsuapi_DsGetMembershipsCtr1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsCtr1 *r);
void ndr_print_drsuapi_DsGetMembershipsCtr(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsCtr *r);
void ndr_print_drsuapi_DsGetMembershipsRequest1(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetMembershipsRequest1 *r);
void ndr_print_drsuapi_DsGetMembershipsRequest(struct ndr_print *ndr, const char *name, const union drsuapi_DsGetMembershipsRequest *r);
void ndr_print_drsuapi_DsGetNT4ChangeLogFlags(strucor(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursor *r);
void ndr_print_drsuapi_DsReplicaCursorCtrEx(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaCursorCtrEx *r);
void ndr_print_drsuapi_DsExtendedOperation(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedOperation r);
void ndr_print_drsuapi_DsExtendedError(struct ndr_print *ndr, const char *name, enum drsuapi_DsExtendedError r);
void ndr_print_drsuapi_DsGetNCChangesRequest5(struct ndr_print *ndr, const char *name, const struct drsuapi_DsGetNCChangesRequest5 *r);
void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r);
void ndr_print_drsuapi_DsReplicaOIDMapping(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOIDMapping *r);
enum ndr_err_code ndr_push_drsuapi_DsReplicaOIDMapping_Ctr(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct drsuapi_DsReplicaOIDMapping_Ctr *r);
enum ndr_err_code ndr_pull_drsuap					  struct tdgram_context *dgram,
					  const uint8_t *buf, size_t len,
					  const struct tsocket_address *dst);
	ssize_t (*sendto_recv)(struct tevent_req *req,
			       int *perrno);

	struct tevent_req *(*disconnect_send)(TALLOC_CTX *mem_ctx,
					      struct tevent_context *ev,
					      struct tdgram_context *dgram);
	int (*disconnect_recv)(struct tevent_req *req,
			       int *perrno);
};

struct tdgram_context *_tdgram_context_create(TALLOC_CTX *mem_ctx,
					const struct tdgram_context_ops *ops,
					void *pstate,
					size_t psize,
					const char *type,
					const char *location);
#define tdgram_context_create(mem_ctx, ops, state, type, location) \
	_tdgram_context_create(mem_ctx, ops, state, sizeof(type), \
				#type, location)

void *_tdgram_context_data(struct tdgram_context *dgram);
#define tdgram_context_data(_req, _type) \
	talloc_get_type_abort(_tdgram_context_data(_req), _type)

struct tstream_context_ops {
	const char *name;

	ssize_t (*pending_bytes)(struct tstream_context *streamThe smbconf context to use.
 *
 * @param[in] service   The definition for the added service.
 *
 * @return              SBC_ERR_OK on success, a corresponding sbcErr if an
 *                      error occurred.
 */
sbcErr smbconf_create_set_share(struct smbconf_ctx *ctx,
				struct smbconf_service *service);

/**
 * @brief Get a definition of a share (service) from configuration.
 *
 * @param[in] ctx       The smbconf context to use.
 *
 * @param[in] mem_ctx   A memory context to allocate the result.
 *
 * @param[in] servicename The service name to get the information from.
 *
 * @param[out] service  A pointer to store the service information about the
 *                      share.
 *
 * @return              SBC_ERR_OK on success, a corresponding sbcErr if an
 *                      error occurred.
 *
 * @see smbconf_service
 */
sbcErr smbconf_get_share(struct smbconf_ctx *ctx,
			 TALLOC_CTX *mem_ctx,
			 const char *servicename,
			 struct smbconf_service **service);

/**
 * @brief Delete a service from cTUS_FWP_DUPLICATE_AUTH_METHOD NT_STATUS(0xc022003c)
#define NT_STATUS_FWP_TCPIP_NOT_READY NT_STATUS(0xc0220100)
#define NT_STATUS_FWP_INJECT_HANDLE_CLOSING NT_STATUS(0xc0220101)
#define NT_STATUS_FWP_INJECT_HANDLE_STALE NT_STATUS(0xc0220102)
#define NT_STATUS_FWP_CANNOT_PEND NT_STATUS(0xc0220103)
#define NT_STATUS_NDIS_CLOSING NT_STATUS(0xc0230002)
#define NT_STATUS_NDIS_BAD_VERSION NT_STATUS(0xc0230004)
#define NT_STATUS_NDIS_BAD_CHARACTERISTICS NT_STATUS(0xc0230005)
#define NT_STATUS_NDIS_ADAPTER_NOT_FOUND NT_STATUS(0xc0230006)
#define NT_STATUS_NDIS_OPEN_FAILED NT_STATUS(0xc0230007)
#define NT_STATUS_NDIS_DEVICE_FAILED NT_STATUS(0xc0230008)
#define NT_STATUS_NDIS_MULTICAST_FULL NT_STATUS(0xc0230009)
#define NT_STATUS_NDIS_MULTICAST_EXISTS NT_STATUS(0xc023000a)
#define NT_STATUS_NDIS_MULTICAST_NOT_FOUND NT_STATUS(0xc023000b)
#define NT_STATUS_NDIS_REQUEST_ABORTED NT_STATUS(0xc023000c)
#define NT_STATUS_NDIS_RESET_IN_PROGRESS NT_STATUS(0xc023000d)
#define NT_STATUS_NDIS_INVALID_PACKET NT_STATUS(0xc023000f)
#APHICS_MULTISAMPLING_NOT_SUPPORTED NT_STATUS(0xc01e0349)
#define NT_STATUS_GRAPHICS_MODE_NOT_IN_MODESET NT_STATUS(0xc01e034a)
#define NT_STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON NT_STATUS(0xc01e034d)
#define NT_STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE NT_STATUS(0xc01e034e)
#define NT_STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE NT_STATUS(0xc01e034f)
#define NT_STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS NT_STATUS(0xc01e0350)
#define NT_STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING NT_STATUS(0xc01e0352)
#define NT_STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED NT_STATUS(0xc01e0353)
#define NT_STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS NT_STATUS(0xc01e0354)
#define NT_STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT NT_STATUS(0xc01e0355)
#define NT_STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM NT_STATUS(0xc01e0356)
#define NT_STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN NT_STATUS(0xc01e0357)
#define NT_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT NT_STATUS(0xc01e0358)
#deT_STATUS(0xc0190052)
#define NT_STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION NT_STATUS(0xc0190053)
#define NT_STATUS_TRANSACTION_NOT_ROOT NT_STATUS(0xc0190054)
#define NT_STATUS_TRANSACTION_OBJECT_EXPIRED NT_STATUS(0xc0190055)
#define NT_STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION NT_STATUS(0xc0190056)
#define NT_STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED NT_STATUS(0xc0190057)
#define NT_STATUS_TRANSACTION_RECORD_TOO_LONG NT_STATUS(0xc0190058)
#define NT_STATUS_NO_LINK_TRACKING_IN_TRANSACTION NT_STATUS(0xc0190059)
#define NT_STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION NT_STATUS(0xc019005a)
#define NT_STATUS_TRANSACTION_INTEGRITY_VIOLATED NT_STATUS(0xc019005b)
#define NT_STATUS_EXPIRED_HANDLE NT_STATUS(0xc0190060)
#define NT_STATUS_TRANSACTION_NOT_ENLISTED NT_STATUS(0xc0190061)
#define NT_STATUS_LOG_SECTOR_INVALID NT_STATUS(0xc01a0001)
#define NT_STATUS_LOG_SECTOR_PARITY_INVALID NT_STATUS(0xc01a0002)
#define NT_STATUS_LOG_SECTOR_REMAPPED NT_STATUS(0xc01a0003)
#define NT_STATUS_LOG_BLOCK_INCOMPLETE NT_ST_SET NT_STATUS(0xc00a0033)
#define NT_STATUS_CTX_CLIENT_LICENSE_IN_USE NT_STATUS(0xc00a0034)
#define NT_STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE NT_STATUS(0xc00a0035)
#define NT_STATUS_CTX_SHADOW_NOT_RUNNING NT_STATUS(0xc00a0036)
#define NT_STATUS_CTX_LOGON_DISABLED NT_STATUS(0xc00a0037)
#define NT_STATUS_CTX_SECURITY_LAYER_ERROR NT_STATUS(0xc00a0038)
#define NT_STATUS_TS_INCOMPATIBLE_SESSIONS NT_STATUS(0xc00a0039)
#define NT_STATUS_MUI_FILE_NOT_FOUND NT_STATUS(0xc00b0001)
#define NT_STATUS_MUI_INVALID_FILE NT_STATUS(0xc00b0002)
#define NT_STATUS_MUI_INVALID_RC_CONFIG NT_STATUS(0xc00b0003)
#define NT_STATUS_MUI_INVALID_LOCALE_NAME NT_STATUS(0xc00b0004)
#define NT_STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME NT_STATUS(0xc00b0005)
#define NT_STATUS_MUI_FILE_NOT_LOADED NT_STATUS(0xc00b0006)
#define NT_STATUS_RESOURCE_ENUM_USER_STOP NT_STATUS(0xc00b0007)
#define NT_STATUS_CLUSTER_INVALID_NODE NT_STATUS(0xc0130001)
#define NT_STATUS_CLUSTER_NODE_EXISTS NT_STATUS(0xc0130002)
#define NT_STATUS_CLUSTER_JOIN_IN_PROGRESS NT_S(0xc002000e)
#define NT_STATUS_RPC_NO_PROTSEQS_REGISTERED NT_STATUS(0xc002000f)
#define NT_STATUS_RPC_NOT_LISTENING NT_STATUS(0xc0020010)
#define NT_STATUS_RPC_UNKNOWN_MGR_TYPE NT_STATUS(0xc0020011)
#define NT_STATUS_RPC_UNKNOWN_IF NT_STATUS(0xc0020012)
#define NT_STATUS_RPC_NO_BINDINGS NT_STATUS(0xc0020013)
#define NT_STATUS_RPC_NO_PROTSEQS NT_STATUS(0xc0020014)
#define NT_STATUS_RPC_CANT_CREATE_ENDPOINT NT_STATUS(0xc0020015)
#define NT_STATUS_RPC_OUT_OF_RESOURCES NT_STATUS(0xc0020016)
#define NT_STATUS_RPC_SERVER_UNAVAILABLE NT_STATUS(0xc0020017)
#define NT_STATUS_RPC_SERVER_TOO_BUSY NT_STATUS(0xc0020018)
#define NT_STATUS_RPC_INVALID_NETWORK_OPTIONS NT_STATUS(0xc0020019)
#define NT_STATUS_RPC_NO_CALL_ACTIVE NT_STATUS(0xc002001a)
#define NT_STATUS_RPC_CALL_FAILED NT_STATUS(0xc002001b)
#define NT_STATUS_RPC_CALL_FAILED_DNE NT_STATUS(0xc002001c)
#define NT_STATUS_RPC_PROTOCOL_ERROR NT_STATUS(0xc002001d)
#define NT_STATUS_RPC_UNSUPPORTED_TRANS_SYN NT_STATUS(0xc002001f)
#define NT_STATUS_RPC_UNSUPPORTED_TYPE NSTATUS_COMMITMENT_MINIMUM NT_STATUS(0xc00002c8)
#define NT_STATUS_REG_NAT_CONSUMPTION NT_STATUS(0xc00002c9)
#define NT_STATUS_TRANSPORT_FULL NT_STATUS(0xc00002ca)
#define NT_STATUS_DS_SAM_INIT_FAILURE NT_STATUS(0xc00002cb)
#define NT_STATUS_ONLY_IF_CONNECTED NT_STATUS(0xc00002cc)
#define NT_STATUS_DS_SENSITIVE_GROUP_VIOLATION NT_STATUS(0xc00002cd)
#define NT_STATUS_PNP_RESTART_ENUMERATION NT_STATUS(0xc00002ce)
#define NT_STATUS_JOURNAL_ENTRY_DELETED NT_STATUS(0xc00002cf)
#define NT_STATUS_DS_CANT_MOD_PRIMARYGROUPID NT_STATUS(0xc00002d0)
#define NT_STATUS_SYSTEM_IMAGE_BAD_SIGNATURE NT_STATUS(0xc00002d1)
#define NT_STATUS_PNP_REBOOT_REQUIRED NT_STATUS(0xc00002d2)
#define NT_STATUS_POWER_STATE_INVALID NT_STATUS(0xc00002d3)
#define NT_STATUS_DS_INVALID_GROUP_TYPE NT_STATUS(0xc00002d4)
#define NT_STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN NT_STATUS(0xc00002d5)
#define NT_STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN NT_STATUS(0xc00002d6)
#define NT_STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER NT_STATUS(0xc00002d7)
#defENTLOG_CANT_START NT_STATUS(0xc000018f)
#define NT_STATUS_TRUST_FAILURE NT_STATUS(0xc0000190)
#define NT_STATUS_MUTANT_LIMIT_EXCEEDED NT_STATUS(0xc0000191)
#define NT_STATUS_NETLOGON_NOT_STARTED NT_STATUS(0xc0000192)
#define NT_STATUS_ACCOUNT_EXPIRED NT_STATUS(0xc0000193)
#define NT_STATUS_POSSIBLE_DEADLOCK NT_STATUS(0xc0000194)
#define NT_STATUS_NETWORK_CREDENTIAL_CONFLICT NT_STATUS(0xc0000195)
#define NT_STATUS_REMOTE_SESSION_LIMIT NT_STATUS(0xc0000196)
#define NT_STATUS_EVENTLOG_FILE_CHANGED NT_STATUS(0xc0000197)
#define NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT NT_STATUS(0xc0000198)
#define NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT NT_STATUS(0xc0000199)
#define NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT NT_STATUS(0xc000019a)
#define NT_STATUS_DOMAIN_TRUST_INCONSISTENT NT_STATUS(0xc000019b)
#define NT_STATUS_FS_DRIVER_REQUIRED NT_STATUS(0xc000019c)
#define NT_STATUS_IMAGE_ALREADY_LOADED_AS_DLL NT_STATUS(0xc000019d)
#define NT_STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING NT_STATUS(0xc000019e)define NT_STATUS_TOO_MANY_CONTEXT_IDS NT_STATUS(0xc000015a)
#define NT_STATUS_LOGON_TYPE_NOT_GRANTED NT_STATUS(0xc000015b)
#define NT_STATUS_NOT_REGISTRY_FILE NT_STATUS(0xc000015c)
#define NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED NT_STATUS(0xc000015d)
#define NT_STATUS_DOMAIN_CTRLR_CONFIG_ERROR NT_STATUS(0xc000015e)
#define NT_STATUS_FT_MISSING_MEMBER NT_STATUS(0xc000015f)
#define NT_STATUS_ILL_FORMED_SERVICE_ENTRY NT_STATUS(0xc0000160)
#define NT_STATUS_ILLEGAL_CHARACTER NT_STATUS(0xc0000161)
#define NT_STATUS_UNMAPPABLE_CHARACTER NT_STATUS(0xc0000162)
#define NT_STATUS_UNDEFINED_CHARACTER NT_STATUS(0xc0000163)
#define NT_STATUS_FLOPPY_VOLUME NT_STATUS(0xc0000164)
#define NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND NT_STATUS(0xc0000165)
#define NT_STATUS_FLOPPY_WRONG_CYLINDER NT_STATUS(0xc0000166)
#define NT_STATUS_FLOPPY_UNKNOWN_ERROR NT_STATUS(0xc0000167)
#define NT_STATUS_FLOPPY_BAD_REGISTERS NT_STATUS(0xc0000168)
#define NT_STATUS_DISK_RECALIBRATE_FAILED NT_STATUS(0xc0000169)
#define NT_STATUS_DISK_OPERATION_FAILED_STATUS_INVALID_DISPOSITION NT_STATUS(0xc0000026)
#define NT_STATUS_UNWIND NT_STATUS(0xc0000027)
#define NT_STATUS_BAD_STACK NT_STATUS(0xc0000028)
#define NT_STATUS_INVALID_UNWIND_TARGET NT_STATUS(0xc0000029)
#define NT_STATUS_NOT_LOCKED NT_STATUS(0xc000002a)
#define NT_STATUS_PARITY_ERROR NT_STATUS(0xc000002b)
#define NT_STATUS_UNABLE_TO_DECOMMIT_VM NT_STATUS(0xc000002c)
#define NT_STATUS_NOT_COMMITTED NT_STATUS(0xc000002d)
#define NT_STATUS_INVALID_PORT_ATTRIBUTES NT_STATUS(0xc000002e)
#define NT_STATUS_PORT_MESSAGE_TOO_LONG NT_STATUS(0xc000002f)
#define NT_STATUS_INVALID_PARAMETER_MIX NT_STATUS(0xc0000030)
#define NT_STATUS_INVALID_QUOTA_LOWER NT_STATUS(0xc0000031)
#define NT_STATUS_DISK_CORRUPT_ERROR NT_STATUS(0xc0000032)
#define NT_STATUS_OBJECT_NAME_INVALID NT_STATUS(0xc0000033)
#define NT_STATUS_OBJECT_NAME_NOT_FOUND NT_STATUS(0xc0000034)
#define NT_STATUS_OBJECT_NAME_COLLISION NT_STATUS(0xc0000035)
#define NT_STATUS_PORT_DISCONNECTED NT_STATUS(0xc0000037)
#define NT_STATUS_DEVICE_ALREADY_ATTACHED NT_SATUS_SHARE_UNAVAILABLE NT_STATUS(0xc0000480)
#define NT_STATUS_CALLBACK_RETURNED_THREAD_AFFINITY NT_STATUS(0xc0000721)
#define NT_STATUS_OBJECT_NAME_EXISTS NT_STATUS(0x40000000)
#define NT_STATUS_THREAD_WAS_SUSPENDED NT_STATUS(0x40000001)
#define NT_STATUS_WORKING_SET_LIMIT_RANGE NT_STATUS(0x40000002)
#define NT_STATUS_IMAGE_NOT_AT_BASE NT_STATUS(0x40000003)
#define NT_STATUS_RXACT_STATE_CREATED NT_STATUS(0x40000004)
#define NT_STATUS_SEGMENT_NOTIFICATION NT_STATUS(0x40000005)
#define NT_STATUS_LOCAL_USER_SESSION_KEY NT_STATUS(0x40000006)
#define NT_STATUS_BAD_CURRENT_DIRECTORY NT_STATUS(0x40000007)
#define NT_STATUS_SERIAL_MORE_WRITES NT_STATUS(0x40000008)
#define NT_STATUS_REGISTRY_RECOVERED NT_STATUS(0x40000009)
#define NT_STATUS_FT_READ_RECOVERY_FROM_BACKUP NT_STATUS(0x4000000a)
#define NT_STATUS_FT_WRITE_RECOVERY NT_STATUS(0x4000000b)
#define NT_STATUS_SERIAL_COUNTER_TIMEOUT NT_STATUS(0x4000000c)
#define NT_STATUS_NULL_LM_PASSWORD NT_STATUS(0x4000000d)
#define NT_STATUS_IMAGE_MACHINE_TYPE_MISMATCH NT_STA4_t debug_traceid_set(uint64_t id);

/* Get the current traceid. */
uint64_t debug_traceid_get(void);

size_t *debug_call_depth_addr(void);

#endif /* _SAMBA_DEBUG_H */
/*
 * Descriptions for errors generated from
 * [MS-ERREF] http://msdn.microsoft.com/en-us/library/cc704588.aspx
 */

#ifndef _NTSTATUS_GEN_H
#define _NTSTATUS_GEN_H
#define NT_STATUS_OK NT_STATUS(0x0)
#define NT_STATUS_SUCCESS NT_STATUS(0x0)
#define NT_STATUS_WAIT_0 NT_STATUS(0x0)
#define NT_STATUS_WAIT_1 NT_STATUS(0x1)
#define NT_STATUS_WAIT_2 NT_STATUS(0x2)
#define NT_STATUS_WAIT_3 NT_STATUS(0x3)
#define NT_STATUS_WAIT_63 NT_STATUS(0x3f)
#define NT_STATUS_ABANDONED NT_STATUS(0x80)
#define NT_STATUS_ABANDONED_WAIT_0 NT_STATUS(0x80)
#define NT_STATUS_ABANDONED_WAIT_63 NT_STATUS(0xbf)
#define NT_STATUS_USER_APC NT_STATUS(0xc0)
#define NT_STATUS_ALERTED NT_STATUS(0x101)
#define NT_STATUS_TIMEOUT NT_STATUS(0x102)
#define NT_STATUS_PENDING NT_STATUS(0x103)
#define NT_STATUS_REPARSE NT_STATUS(0x104)
#define NT_STATUS_MORE_ENTRIES NT_STATUS(0x105)
ue] */
};

union CLAIM_ENTRY_VALUES {
	struct CLAIM_INT64 claim_int64;/* [case(CLAIM_TYPE_INT64)] */
	struct CLAIM_UINT64 claim_uint64;/* [case(CLAIM_TYPE_UINT64)] */
	struct CLAIM_STRING claim_string;/* [case(CLAIM_TYPE_STRING)] */
	struct CLAIM_UINT64 claim_boolean;/* [case(CLAIM_TYPE_BOOLEAN)] */
}/* [flag(LIBNDR_FLAG_ALIGN8),switch_type(CLAIM_TYPE)] */;

struct CLAIM_ENTRY {
	const char *id;/* [charset(UTF16),unique] */
	enum CLAIM_TYPE type;
	union CLAIM_ENTRY_VALUES values;/* [switch_is(type)] */
};

struct CLAIMS_ARRAY {
	enum CLAIMS_SOURCE_TYPE claims_source_type;
	uint32_t claims_count;
	struct CLAIM_ENTRY *claim_entries;/* [size_is(claims_count),unique] */
};

struct CLAIMS_SET_METADATA_CTR {
	struct CLAIMS_SET_METADATA *metadata;/* [unique] */
};

struct CLAIMS_SET_CTR {
	struct CLAIMS_SET *claims;/* [unique] */
};

struct CLAIMS_SET {
	uint32_t claims_array_count;
	struct CLAIMS_ARRAY *claims_arrays;/* [size_is(claims_array_count),unique] */
	uint16_t reserved_type;
	uint32_t reserved_field_size;
do {if (!(h)) DCESRV_FAULT(DCERPC_FAULT_CONTEXT_MISMATCH); } while (0)

/* this checks for a valid policy handle, and gives a fault if an
   invalid handle or retval if the handle is of the
   wrong type */
#define DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, retval) do { \
	(h) = dcesrv_handle_lookup(dce_call, (inhandle), DCESRV_HANDLE_ANY); \
	DCESRV_CHECK_HANDLE(h); \
	if ((t) != DCESRV_HANDLE_ANY && (h)->wire_handle.handle_type != (t)) { \
		return retval; \
	} \
} while (0)

/* this checks for a valid policy handle and gives a dcerpc fault
   if its the wrong type of handle */
#define DCESRV_PULL_HANDLE_FAULT(h, inhandle, t) do { \
	(h) = dcesrv_handle_lookup(dce_call, (inhandle), t); \
	DCESRV_CHECK_HANDLE(h); \
} while (0)

#define DCESRV_PULL_HANDLE(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, NT_STATUS_INVALID_HANDLE)
#define DCESRV_PULL_HANDLE_WERR(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, WERR_INVALID_HANDLE)

/**
 * retrieve credentials from a dce_call
 */
_PUBLIC_ structn_ndr/security.h>

/* modules can use the following to determine if the interface has changed
 * please increment the version number after each interface change
 * with a comment and maybe update struct dcesrv_critical_sizes.
 */
/* version 1 - initial version - metze */
#define DCERPC_MODULE_VERSION 1

struct dcesrv_connection;
struct dcesrv_call_state;
struct dcesrv_auth;
struct dcesrv_connection_context;
struct dcesrv_iface_state;
struct cli_credentials;

struct dcesrv_interface {
	const char *name;
	struct ndr_syntax_id syntax_id;

	/* this function is called when the client binds to this interface  */
	NTSTATUS (*bind)(struct dcesrv_connection_context *, const struct dcesrv_interface *);

	/* this function is called when the client disconnects the endpoint */
	void (*unbind)(struct dcesrv_connection_context *, const struct dcesrv_interface *);

	/* the ndr_pull function for the chosen interface.
	 */
	NTSTATUS (*ndr_pull)(struct dcesrv_call_state *, TALLOC_CTX *, struct ndr_pull *, void **);

	/* the disID requester_sid;/* [case(PAC_TYPE_REQUESTER_SID)] */
	struct DATA_BLOB_REM client_claims_info;/* [case(PAC_TYPE_CLIENT_CLAIMS_INFO),subcontext(0)] */
	struct PAC_DEVICE_INFO_CTR device_info;/* [case(PAC_TYPE_DEVICE_INFO),subcontext(0xFFFFFC01)] */
	struct DATA_BLOB_REM device_claims_info;/* [case(PAC_TYPE_DEVICE_CLAIMS_INFO),subcontext(0)] */
	struct PAC_SIGNATURE_DATA full_checksum;/* [case(PAC_TYPE_FULL_CHECKSUM)] */
	struct DATA_BLOB_REM unknown;/* [default,subcontext(0)] */
}/* [gensize,nodiscriminant,public] */;

struct PAC_BUFFER {
	enum PAC_TYPE type;
	uint32_t _ndr_size;/* [value(_ndr_size_PAC_INFO(info,type,LIBNDR_FLAG_ALIGN8))] */
	union PAC_INFO *info;/* [flag(LIBNDR_FLAG_ALIGN8),relative,subcontext(0),subcontext_size(NDR_ROUND(_ndr_size,8)),switch_is(type)] */
	uint32_t _pad;/* [value(0)] */
}/* [nopull,nopush,public] */;

struct PAC_DATA {
	uint32_t num_buffers;
	uint32_t version;
	struct PAC_BUFFER *buffers;
}/* [public] */;

struct PAC_BUFFER_RAW {
	enum PAC_TYPE type;
	uint32_t ndr_size;
	str const char *name, ndr_flags_type flags, const struct samr_SetUserInfo *r);
void ndr_print_samr_ChangePasswordUser(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct samr_ChangePasswordUser *r);
void ndr_print_samr_GetGroupsForUser(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct samr_GetGroupsForUser *r);
void ndr_print_samr_QueryDisplayInfo(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct samr_QueryDisplayInfo *r);
void ndr_print_samr_GetDisplayEnumerationIndex(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct samr_GetDisplayEnumerationIndex *r);
void ndr_print_samr_TestPrivateFunctionsDomain(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct samr_TestPrivateFunctionsDomain *r);
void ndr_print_samr_TestPrivateFunctionsUser(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct samr_TestPrivateFunctionsUser *r);
enum ndr_err_code ndr_push_samr_GetUserPwInfo(stum samr_GroupInfoEnum r);
void ndr_print_samr_GroupInfo(struct ndr_print *ndr, const char *name, const union samr_GroupInfo *r);
void ndr_print_samr_RidAttrArray(struct ndr_print *ndr, const char *name, const struct samr_RidAttrArray *r);
void ndr_print_samr_AliasInfoAll(struct ndr_print *ndr, const char *name, const struct samr_AliasInfoAll *r);
void ndr_print_samr_AliasInfoEnum(struct ndr_print *ndr, const char *name, enum samr_AliasInfoEnum r);
void ndr_print_samr_AliasInfo(struct ndr_print *ndr, const char *name, const union samr_AliasInfo *r);
void ndr_print_samr_UserInfoLevel(struct ndr_print *ndr, const char *name, enum samr_UserInfoLevel r);
void ndr_print_samr_UserInfo1(struct ndr_print *ndr, const char *name, const struct samr_UserInfo1 *r);
void ndr_print_samr_UserInfo2(struct ndr_print *ndr, const char *name, const struct samr_UserInfo2 *r);
enum ndr_err_code ndr_push_samr_LogonHours(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct samr_LogonHours *r);
enum ndr_err_code ndr_pull_samr_Lse
#define PRINTF_ATTRIBUTE(a1, a2)
#endif
#endif

#ifndef FORMAT_ATTRIBUTE
#if __has_attribute(format) || ( (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 ) )
/** Use gcc attribute to check printf fns.  a1 is argument to format()
 * in the above macro.  This is needed to support Heimdal's printf
 * decorations. Note that some gcc 2.x versions don't handle this
 * properly. **/
#define FORMAT_ATTRIBUTE(a) __attribute__ ((format a))
#else
#define FORMAT_ATTRIBUTE(a)
#endif
#endif

#endif /* __UTIL_ATTR_H__ */
/* header auto-generated by pidl */

#include <ndr.h>
#include <gen_ndr/samr.h>

#ifndef _HEADER_NDR_samr
#define _HEADER_NDR_samr

#define NDR_SAMR_UUID "12345778-1234-abcd-ef00-0123456789ac"
#define NDR_SAMR_VERSION 1.0
#define NDR_SAMR_NAME "samr"
#define NDR_SAMR_HELPSTRING NULL
extern const struct ndr_interface_table ndr_table_samr;
#define NDR_SAMR_CONNECT (0x00)

#define NDR_SAMR_CLOSE (0x01)

#define NDR_SAMR_SETSECURITY (0x02)

#define NDR_SAMR_QUERYSECURITY (0x03)

#define NDR_SAMR_SHUTDOWN (0x04)

#den_handlers);

void smb_init_locale(void);

/* The following definitions come from util_unistr_w.c  */

size_t strlen_w(const smb_ucs2_t *src);
size_t strnlen_w(const smb_ucs2_t *src, size_t max);
smb_ucs2_t *strchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
smb_ucs2_t *strchr_wa(const smb_ucs2_t *s, char c);
smb_ucs2_t *strrchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins);
bool strlower_w(smb_ucs2_t *s);
bool strupper_w(smb_ucs2_t *s);
int strcasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b);
int strncasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len);
int strcmp_wa(const smb_ucs2_t *a, const char *b);
smb_ucs2_t toupper_w(smb_ucs2_t v);

#endif /* __CHARSET_H__ */
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include/samba-4.0

Name: ndr-standard
Description: NDR marshallers for the standard set of DCE/RPC interfaces
Requires: ndr
Version: 0.0.1
Libs:  -L${libdir} -lndr-standard
Cflags: -I${includedir}  -DHAVE_IMze_t *inbytesleft,
		       char **outbuf, size_t *outbytesleft);
	void *cd_direct, *cd_pull, *cd_push;
	char *from_name, *to_name;
} *smb_iconv_t;

/* string manipulation flags */
#define STR_TERMINATE 1
#define STR_UPPER 2
#define STR_ASCII 4
#define STR_UNICODE 8
#define STR_NOALIGN 16
#define STR_NO_RANGE_CHECK 32
#define STR_LEN8BIT 64
#define STR_TERMINATE_ASCII 128 /* only terminate if ascii */
#define STR_LEN_NOTERM 256 /* the length field is the unterminated length */

struct loadparm_context;
struct smb_iconv_handle;

size_t ucs2_align(const void *base_ptr, const void *p, int flags);

/**
return the number of bytes occupied by a buffer in CH_UTF16 format
**/
size_t utf16_len(const void *buf);

/**
return the number of bytes occupied by a buffer in CH_UTF16 format
the result includes the null termination
**/
size_t utf16_null_terminated_len(const void *buf);

/**
return the number of bytes occupied by a buffer in CH_UTF16 format
limited by 'n' bytes
**/
size_t utf16_len_n(const void *src, size_t n);
error,
				  enum wbcPasswordChangeRejectReason *reject_reason,
				  struct wbcUserPasswordPolicyInfo **policy);

/**
 * @brief Change a password for a user with more detailed information upon
 *   failure
 *
 * @param params                Input parameters
 * @param error                 User output details on WBC_ERR_PWD_CHANGE_FAILED
 * @param reject_reason         New password reject reason on WBC_ERR_PWD_CHANGE_FAILED
 * @param policy                Password policy output details on WBC_ERR_PWD_CHANGE_FAILED
 *
 * @return #wbcErr
 **/
wbcErr wbcChangeUserPasswordEx(const struct wbcChangePasswordParams *params,
			       struct wbcAuthErrorInfo **error,
			       enum wbcPasswordChangeRejectReason *reject_reason,
			       struct wbcUserPasswordPolicyInfo **policy);

/**
 * @brief Authenticate a user with cached credentials
 *
 * @param *ctx       wbclient Context
 * @param *params    Pointer to a wbcCredentialCacheParams structure
 * @param **info     Pointer to a pointer to a wbcCredentialCacheInfo strC_LOOKUP_DC_GOOD_TIMESERV_PREFERRED  0x00002000
#define WBC_LOOKUP_DC_AVOID_SELF               0x00004000
#define WBC_LOOKUP_DC_ONLY_LDAP_NEEDED         0x00008000
#define WBC_LOOKUP_DC_IS_FLAT_NAME             0x00010000
#define WBC_LOOKUP_DC_IS_DNS_NAME              0x00020000
#define WBC_LOOKUP_DC_TRY_NEXTCLOSEST_SITE     0x00040000
#define WBC_LOOKUP_DC_DS_6_REQUIRED            0x00080000
#define WBC_LOOKUP_DC_RETURN_DNS_NAME          0x40000000
#define WBC_LOOKUP_DC_RETURN_FLAT_NAME         0x80000000

/**
 * @brief Enumerate the domain trusts known by Winbind
 *
 * @param *ctx          wbclient Context
 * @param domain        Name of the domain to query for a DC
 * @param flags         Bit flags used to control the domain location query
 * @param *dc_info      Pointer to the returned domain controller information
 *
 * @return #wbcErr
 **/
wbcErr wbcCtxLookupDomainController(struct wbcContext *ctx,
				    const char *domain,
				    uint32_t flags,
				    struct wbcDomainControllerInfo **dc_info);

/*turn #wbcErr
 *
 * @deprecated      This method is not implemented any more and should
 *                  be removed in the next major version change.
 **/
wbcErr wbcSetUidHwm(uid_t uid_hwm);

/**
 * @brief Set the highwater mark for allocated gids.
 *
 * @param gid_hwm      The new gid highwater mark value
 *
 * @return #wbcErr
 *
 * @deprecated      This method is not implemented any more and should
 *                  be removed in the next major version change.
 **/
wbcErr wbcSetGidHwm(gid_t gid_hwm);

/**********************************************************
 * NSS Lookup User/Group details
 **********************************************************/

/**
 * @brief Fill in a struct passwd* for a domain user based
 *   on username
 *
 * @param *ctx      wbclient Context
 * @param *name     Username to lookup
 * @param **pwd     Pointer to resulting struct passwd* from the query.
 *
 * @return #wbcErr
 **/
wbcErr wbcCtxGetpwnam(struct wbcContext *ctx,
		      const char *name, struct passwd **pwd);

/**txLookupName(struct wbcContext *ctx,
			const char *dom_name,
			const char *name,
			struct wbcDomainSid *sid,
			enum wbcSidType *name_type);

/**
 * @brief Convert a domain and name to SID
 *
 * @param dom_name    Domain name (possibly "")
 * @param name        User or group name
 * @param *sid        Pointer to the resolved domain SID
 * @param *name_type  Pointer to the SID type
 *
 * @return #wbcErr
 **/
wbcErr wbcLookupName(const char *dom_name,
		     const char *name,
		     struct wbcDomainSid *sid,
		     enum wbcSidType *name_type);

/**
 * @brief Convert a SID to a domain and name
 *
 * @param *ctx       wbclient Context
 * @param *sid       Pointer to the domain SID to be resolved
 * @param domain     Resolved Domain name (possibly "")
 * @param name       Resolved User or group name
 * @param *name_type Pointer to the resolved SID type
 *
 * @return #wbcErr
 **/
wbcErr wbcCtxLookupSid(struct wbcContext *ctx,
		       const struct wbcDomainSid *sid,
		       char **domain,
		       char **name,
	char *account_name;
	char *user_principal;
	char *full_name;
	char *domain_name;
	char *dns_domain_name;

	uint32_t acct_flags;
	uint8_t user_session_key[16];
	uint8_t lm_session_key[8];

	uint16_t logon_count;
	uint16_t bad_password_count;

	uint64_t logon_time;
	uint64_t logoff_time;
	uint64_t kickoff_time;
	uint64_t pass_last_set_time;
	uint64_t pass_can_change_time;
	uint64_t pass_must_change_time;

	char *logon_server;
	char *logon_script;
	char *profile_path;
	char *home_directory;
	char *home_drive;

	/*
	 * the 1st one is the account sid
	 * the 2nd one is the primary_group sid
	 * followed by the rest of the groups
	 */
	uint32_t num_sids;
	struct wbcSidWithAttr *sids;
};

/**
 * @brief Logon User Information
 *
 * Some of the strings are maybe NULL
 **/

struct wbcLogonUserInfo {
	struct wbcAuthUserInfo *info;
	size_t num_blobs;
	struct wbcNamedBlob *blobs;
};

/* wbcAuthUserInfo->user_flags */

#define WBC_AUTH_USER_INFO_GUEST			0x00000001
#define WBC_AUTH_USER_INFO_NOENCRYPTION			0x00000002
#defi/

#ifndef _SAMBA_SUBSTITUTE_H_
#define _SAMBA_SUBSTITUTE_H_

#include <talloc.h>

/**
 Substitute a string for a pattern in another string. Make sure there is
 enough room!

 This routine looks for pattern in s and replaces it with
 insert. It may do multiple replacements.

 Any of " ; ' $ or ` in the insert string are replaced with _
 if len==0 then the string cannot be extended. This is different from the old
 use of len==0 which was for no length checks to be done.
**/
void string_sub(char *s,const char *pattern, const char *insert, size_t len);

/**
 Similar to string_sub() but allows for any character to be substituted.
 Use with caution!
 if len==0 then the string cannot be extended. This is different from the old
 use of len==0 which was for no length checks to be done.
**/
void all_string_sub(char *s,const char *pattern,const char *insert, size_t len);

char *talloc_string_sub2(TALLOC_CTX *mem_ctx, const char *src,
			const char *pattern,
			const char *insert,
			bool remove_unsafe_characters,
			boROR(0x80300106)
#define HRES_PLA_E_EXE_ALREADY_CONFIGURED                 HRES_ERROR(0x80300107)
#define HRES_PLA_E_EXE_PATH_NOT_VALID                     HRES_ERROR(0x80300108)
#define HRES_PLA_E_DC_ALREADY_EXISTS                      HRES_ERROR(0x80300109)
#define HRES_PLA_E_DCS_START_WAIT_TIMEOUT                 HRES_ERROR(0x8030010A)
#define HRES_PLA_E_DC_START_WAIT_TIMEOUT                  HRES_ERROR(0x8030010B)
#define HRES_PLA_E_REPORT_WAIT_TIMEOUT                    HRES_ERROR(0x8030010C)
#define HRES_PLA_E_NO_DUPLICATES                          HRES_ERROR(0x8030010D)
#define HRES_PLA_E_EXE_FULL_PATH_REQUIRED                 HRES_ERROR(0x8030010E)
#define HRES_PLA_E_INVALID_SESSION_NAME                   HRES_ERROR(0x8030010F)
#define HRES_PLA_E_PLA_CHANNEL_NOT_ENABLED                HRES_ERROR(0x80300110)
#define HRES_PLA_E_TASKSCHED_CHANNEL_NOT_ENABLED          HRES_ERROR(0x80300111)
#define HRES_FVE_E_LOCKED_VOLUME                          HRES_ERROR(0x80310000)
#define HRES_FVE_E_NOT_ENCRYPTED    DEVICE_OBJECT                   HRES_ERROR(0x801F0019)
#define HRES_ERROR_FLT_VOLUME_ALREADY_MOUNTED             HRES_ERROR(0x801F001A)
#define HRES_ERROR_FLT_ALREADY_ENLISTED                   HRES_ERROR(0x801F001B)
#define HRES_ERROR_FLT_CONTEXT_ALREADY_LINKED             HRES_ERROR(0x801F001C)
#define HRES_ERROR_FLT_NO_WAITER_FOR_REPLY                HRES_ERROR(0x801F0020)
#define HRES_ERROR_HUNG_DISPLAY_DRIVER_THREAD             HRES_ERROR(0x80260001)
#define HRES_ERROR_MONITOR_NO_DESCRIPTOR                  HRES_ERROR(0x80261001)
#define HRES_ERROR_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT      HRES_ERROR(0x80261002)
#define HRES_DWM_E_COMPOSITIONDISABLED                    HRES_ERROR(0x80263001)
#define HRES_DWM_E_REMOTING_NOT_SUPPORTED                 HRES_ERROR(0x80263002)
#define HRES_DWM_E_NO_REDIRECTION_SURFACE_AVAILABLE       HRES_ERROR(0x80263003)
#define HRES_DWM_E_NOT_QUEUING_PRESENTS                   HRES_ERROR(0x80263004)
#define HRES_TPM_E_ERROR_MASK                             HRES_ERROR(0x80280008011044B)
#define HRES_COMADMIN_E_CAN_NOT_EXPORT_SYS_APP            HRES_ERROR(0x8011044C)
#define HRES_COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT       HRES_ERROR(0x8011044D)
#define HRES_COMADMIN_E_EVENTCLASS_CANT_BE_SUBSCRIBER     HRES_ERROR(0x8011044E)
#define HRES_COMADMIN_E_LIB_APP_PROXY_INCOMPATIBLE        HRES_ERROR(0x8011044F)
#define HRES_COMADMIN_E_BASE_PARTITION_ONLY               HRES_ERROR(0x80110450)
#define HRES_COMADMIN_E_START_APP_DISABLED                HRES_ERROR(0x80110451)
#define HRES_COMADMIN_E_CAT_DUPLICATE_PARTITION_NAME      HRES_ERROR(0x80110457)
#define HRES_COMADMIN_E_CAT_INVALID_PARTITION_NAME        HRES_ERROR(0x80110458)
#define HRES_COMADMIN_E_CAT_PARTITION_IN_USE              HRES_ERROR(0x80110459)
#define HRES_COMADMIN_E_FILE_PARTITION_DUPLICATE_FILES    HRES_ERROR(0x8011045A)
#define HRES_COMADMIN_E_CAT_IMPORTED_COMPONENTS_NOT_ALLOWED HRES_ERROR(0x8011045B)
#define HRES_COMADMIN_E_AMBIGUOUS_APPLICATION_NAME        HRES_ERROR(0x8011045C)
#define HRES_COMADMIN_E_AMBIGUOUS_PARTIT_ERROR(0x800F0243)
#define HRES_SPAPI_E_SIGNATURE_OSATTRIBUTE_MISMATCH       HRES_ERROR(0x800F0244)
#define HRES_SPAPI_E_ONLY_VALIDATE_VIA_AUTHENTICODE       HRES_ERROR(0x800F0245)
#define HRES_SPAPI_E_DEVICE_INSTALLER_NOT_READY           HRES_ERROR(0x800F0246)
#define HRES_SPAPI_E_DRIVER_STORE_ADD_FAILED              HRES_ERROR(0x800F0247)
#define HRES_SPAPI_E_DEVICE_INSTALL_BLOCKED               HRES_ERROR(0x800F0248)
#define HRES_SPAPI_E_DRIVER_INSTALL_BLOCKED               HRES_ERROR(0x800F0249)
#define HRES_SPAPI_E_WRONG_INF_TYPE                       HRES_ERROR(0x800F024A)
#define HRES_SPAPI_E_FILE_HASH_NOT_IN_CATALOG             HRES_ERROR(0x800F024B)
#define HRES_SPAPI_E_DRIVER_STORE_DELETE_FAILED           HRES_ERROR(0x800F024C)
#define HRES_SPAPI_E_UNRECOVERABLE_STACK_OVERFLOW         HRES_ERROR(0x800F0300)
#define HRES_SPAPI_E_ERROR_NOT_INSTALLED                  HRES_ERROR(0x800F1000)
#define HRES_SCARD_F_INTERNAL_ERROR                       HRES_ERROR(0x80100001)
#define HRES_SCARD_E_CANCELLED   ERROR(0x8009700C)
#define HRES_MSSIPOTF_E_FILE_CHECKSUM                     HRES_ERROR(0x8009700D)
#define HRES_MSSIPOTF_E_FAILED_POLICY                     HRES_ERROR(0x80097010)
#define HRES_MSSIPOTF_E_FAILED_HINTS_CHECK                HRES_ERROR(0x80097011)
#define HRES_MSSIPOTF_E_NOT_OPENTYPE                      HRES_ERROR(0x80097012)
#define HRES_MSSIPOTF_E_FILE                              HRES_ERROR(0x80097013)
#define HRES_MSSIPOTF_E_CRYPT                             HRES_ERROR(0x80097014)
#define HRES_MSSIPOTF_E_BADVERSION                        HRES_ERROR(0x80097015)
#define HRES_MSSIPOTF_E_DSIG_STRUCTURE                    HRES_ERROR(0x80097016)
#define HRES_MSSIPOTF_E_PCONST_CHECK                      HRES_ERROR(0x80097017)
#define HRES_MSSIPOTF_E_STRUCTURE                         HRES_ERROR(0x80097018)
#define HRES_ERROR_CRED_REQUIRES_CONFIRMATION             HRES_ERROR(0x80097019)
#define HRES_TRUST_E_PROVIDER_UNKNOWN                     HRES_ERROR(0x800B0001)
#define HRES_TRUST_E_ACTION_UNKNOW0090334)
#define HRES_SEC_E_NO_IP_ADDRESSES                        HRES_ERROR(0x80090335)
#define HRES_SEC_E_WRONG_CREDENTIAL_HANDLE                HRES_ERROR(0x80090336)
#define HRES_SEC_E_CRYPTO_SYSTEM_INVALID                  HRES_ERROR(0x80090337)
#define HRES_SEC_E_MAX_REFERRALS_EXCEEDED                 HRES_ERROR(0x80090338)
#define HRES_SEC_E_MUST_BE_KDC                            HRES_ERROR(0x80090339)
#define HRES_SEC_E_STRONG_CRYPTO_NOT_SUPPORTED            HRES_ERROR(0x8009033A)
#define HRES_SEC_E_TOO_MANY_PRINCIPALS                    HRES_ERROR(0x8009033B)
#define HRES_SEC_E_NO_PA_DATA                             HRES_ERROR(0x8009033C)
#define HRES_SEC_E_PKINIT_NAME_MISMATCH                   HRES_ERROR(0x8009033D)
#define HRES_SEC_E_SMARTCARD_LOGON_REQUIRED               HRES_ERROR(0x8009033E)
#define HRES_SEC_E_SHUTDOWN_IN_PROGRESS                   HRES_ERROR(0x8009033F)
#define HRES_SEC_E_KDC_INVALID_REQUEST                    HRES_ERROR(0x80090340)
#define HRES_SEC_E_KDC_UNABLE_TO_REFER     80090025)
#define HRES_NTE_INVALID_HANDLE                           HRES_ERROR(0x80090026)
#define HRES_NTE_INVALID_PARAMETER                        HRES_ERROR(0x80090027)
#define HRES_NTE_BUFFER_TOO_SMALL                         HRES_ERROR(0x80090028)
#define HRES_NTE_NOT_SUPPORTED                            HRES_ERROR(0x80090029)
#define HRES_NTE_NO_MORE_ITEMS                            HRES_ERROR(0x8009002A)
#define HRES_NTE_BUFFERS_OVERLAP                          HRES_ERROR(0x8009002B)
#define HRES_NTE_DECRYPTION_FAILURE                       HRES_ERROR(0x8009002C)
#define HRES_NTE_INTERNAL_ERROR                           HRES_ERROR(0x8009002D)
#define HRES_NTE_UI_REQUIRED                              HRES_ERROR(0x8009002E)
#define HRES_NTE_HMAC_NOT_SUPPORTED                       HRES_ERROR(0x8009002F)
#define HRES_SEC_E_INSUFFICIENT_MEMORY                    HRES_ERROR(0x80090300)
#define HRES_SEC_E_INVALID_HANDLE                         HRES_ERROR(0x80090301)
#define HRES_SEC_E_UNSUPPORTED_FUNCTION   (0x8004020F)
#define HRES_EVENT_E_PER_USER_SID_NOT_LOGGED_ON           HRES_ERROR(0x80040210)
#define HRES_SCHED_E_TRIGGER_NOT_FOUND                    HRES_ERROR(0x80041309)
#define HRES_SCHED_E_TASK_NOT_READY                       HRES_ERROR(0x8004130A)
#define HRES_SCHED_E_TASK_NOT_RUNNING                     HRES_ERROR(0x8004130B)
#define HRES_SCHED_E_SERVICE_NOT_INSTALLED                HRES_ERROR(0x8004130C)
#define HRES_SCHED_E_CANNOT_OPEN_TASK                     HRES_ERROR(0x8004130D)
#define HRES_SCHED_E_INVALID_TASK                         HRES_ERROR(0x8004130E)
#define HRES_SCHED_E_ACCOUNT_INFORMATION_NOT_SET          HRES_ERROR(0x8004130F)
#define HRES_SCHED_E_ACCOUNT_NAME_NOT_FOUND               HRES_ERROR(0x80041310)
#define HRES_SCHED_E_ACCOUNT_DBASE_CORRUPT                HRES_ERROR(0x80041311)
#define HRES_SCHED_E_NO_SECURITY_SERVICES                 HRES_ERROR(0x80041312)
#define HRES_SCHED_E_UNKNOWN_OBJECT_VERSION               HRES_ERROR(0x80041313)
#define HRES_SCHED_E_UNSUPPORTED_ACCOUNRROR(0x8001013D)
#define HRES_CO_E_ACNOTINITIALIZED                        HRES_ERROR(0x8001013F)
#define HRES_CO_E_CANCEL_DISABLED                         HRES_ERROR(0x80010140)
#define HRES_RPC_E_UNEXPECTED                             HRES_ERROR(0x8001FFFF)
#define HRES_DISP_E_UNKNOWNINTERFACE                      HRES_ERROR(0x80020001)
#define HRES_DISP_E_MEMBERNOTFOUND                        HRES_ERROR(0x80020003)
#define HRES_DISP_E_PARAMNOTFOUND                         HRES_ERROR(0x80020004)
#define HRES_DISP_E_TYPEMISMATCH                          HRES_ERROR(0x80020005)
#define HRES_DISP_E_UNKNOWNNAME                           HRES_ERROR(0x80020006)
#define HRES_DISP_E_NONAMEDARGS                           HRES_ERROR(0x80020007)
#define HRES_DISP_E_BADVARTYPE                            HRES_ERROR(0x80020008)
#define HRES_DISP_E_EXCEPTION                             HRES_ERROR(0x80020009)
#define HRES_DISP_E_OVERFLOW                              HRES_ERROR(0x8002000A)
#define HRES_DISP_E_BADINDEX       (0x8000401F)
#define HRES_CO_E_IIDREG_INCONSISTENT                     HRES_ERROR(0x80004020)
#define HRES_CO_E_NOT_SUPPORTED                           HRES_ERROR(0x80004021)
#define HRES_CO_E_RELOAD_DLL                              HRES_ERROR(0x80004022)
#define HRES_CO_E_MSI_ERROR                               HRES_ERROR(0x80004023)
#define HRES_CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT HRES_ERROR(0x80004024)
#define HRES_CO_E_SERVER_PAUSED                           HRES_ERROR(0x80004025)
#define HRES_CO_E_SERVER_NOT_PAUSED                       HRES_ERROR(0x80004026)
#define HRES_CO_E_CLASS_DISABLED                          HRES_ERROR(0x80004027)
#define HRES_CO_E_CLRNOTAVAILABLE                         HRES_ERROR(0x80004028)
#define HRES_CO_E_ASYNC_WORK_REJECTED                     HRES_ERROR(0x80004029)
#define HRES_CO_E_SERVER_INIT_TIMEOUT                     HRES_ERROR(0x8000402A)
#define HRES_CO_E_NO_SECCTX_IN_ACTIVATE                   HRES_ERROR(0x8000402B)
#define HRES_CO_E_TRACKER_CONFIG      0x001F0001)
#define HRES_ERROR_GRAPHICS_MODE_NOT_PINNED               HRES_ERROR(0x00262307)
#define HRES_ERROR_GRAPHICS_NO_PREFERRED_MODE             HRES_ERROR(0x0026231E)
#define HRES_ERROR_GRAPHICS_DATASET_IS_EMPTY              HRES_ERROR(0x0026234B)
#define HRES_ERROR_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET   HRES_ERROR(0x0026234C)
#define HRES_ERROR_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_PINNED HRES_ERROR(0x00262351)
#define HRES_PLA_S_PROPERTY_IGNORED                       HRES_ERROR(0x00300100)
#define HRES_ERROR_NDIS_INDICATION_REQUIRED               HRES_ERROR(0x00340001)
#define HRES_TRK_S_OUT_OF_SYNC                            HRES_ERROR(0x0DEAD100)
#define HRES_TRK_VOLUME_NOT_FOUND                         HRES_ERROR(0x0DEAD102)
#define HRES_TRK_VOLUME_NOT_OWNED                         HRES_ERROR(0x0DEAD103)
#define HRES_TRK_S_NOTIFICATION_QUOTA_EXCEEDED            HRES_ERROR(0x0DEAD107)
#define HRES_NS_I_TIGER_START                             HRES_ERROR(0x400D004F)
#define HRES_NS_I_CUB_T_H_
#define _HRESULT_H_

#if defined(HAVE_IMMEDIATE_STRUCTURES)
typedef struct {uint32_t h;} HRESULT;
#define HRES_ERROR(x) ((HRESULT) { x })
#define HRES_ERROR_V(x) ((x).h)
#else
typedef uint32_t HRESULT;
#define HRES_ERROR(x) (x)
#define HRES_ERROR_V(x) (x)
#endif

#define HRES_IS_OK(x) (HRES_ERROR_V(x) == 0)
#define HRES_IS_EQUAL(x,y) (HRES_ERROR_V(x) == HRES_ERROR_V(y))


/*
 * The following error codes are autogenerated from [MS-ERREF]
 * see http://msdn.microsoft.com/en-us/library/cc704587.aspx
 */

#define HRES_STG_S_CONVERTED                              HRES_ERROR(0x00030200)
#define HRES_STG_S_BLOCK                                  HRES_ERROR(0x00030201)
#define HRES_STG_S_RETRYNOW                               HRES_ERROR(0x00030202)
#define HRES_STG_S_MONITORING                             HRES_ERROR(0x00030203)
#define HRES_STG_S_MULTIPLEOPENS                          HRES_ERROR(0x00030204)
#define HRES_STG_S_CONSOLIDATIONFAILED                    HRES_ERROR(0x00030205)
#define HRES_STG_S_CANNOTCset(UTF16),unique] */
		struct lsa_ObjectAttribute *attr;/* [ref] */
		uint32_t access_mask;
	} in;

	struct {
		struct policy_handle *handle;/* [ref] */
		NTSTATUS result;
	} out;

};


struct lsa_GetUserName {
	struct {
		const char *system_name;/* [charset(UTF16),unique] */
		struct lsa_String **account_name;/* [ref] */
		struct lsa_String **authority_name;/* [unique] */
	} in;

	struct {
		struct lsa_String **account_name;/* [ref] */
		struct lsa_String **authority_name;/* [unique] */
		NTSTATUS result;
	} out;

};


struct lsa_QueryInfoPolicy2 {
	struct {
		struct policy_handle *handle;/* [ref] */
		enum lsa_PolicyInfo level;
	} in;

	struct {
		union lsa_PolicyInformation **info;/* [ref,switch_is(level)] */
		NTSTATUS result;
	} out;

};


struct lsa_SetInfoPolicy2 {
	struct {
		struct policy_handle *handle;/* [ref] */
		enum lsa_PolicyInfo level;
		union lsa_PolicyInformation *info;/* [ref,switch_is(level)] */
	} in;

	struct {
		NTSTATUS result;
	} out;

};


struct lsa_QueryTrustedDomainInfoByName {
nfo;/* [case(LSA_FOREST_TRUST_DOMAIN_INFO)] */
	struct lsa_ForestTrustBinaryData data;/* [case(LSA_FOREST_TRUST_BINARY_DATA)] */
	struct lsa_ForestTrustDomainInfo scanner_info;/* [case(LSA_FOREST_TRUST_SCANNER_INFO)] */
}/* [switch_type(lsa_ForestTrustRecordType)] */;

struct lsa_ForestTrustRecord2 {
	uint32_t flags;
	enum lsa_ForestTrustRecordType type;
	NTTIME time;
	union lsa_ForestTrustData2 forest_trust_data;/* [switch_is(type)] */
};

struct lsa_ForestTrustInformation2 {
	uint32_t count;/* [range(0,4000)] */
	struct lsa_ForestTrustRecord2 **entries;/* [size_is(count),unique] */
}/* [public] */;


struct lsa_Close {
	struct {
		struct policy_handle *handle;/* [ref] */
	} in;

	struct {
		struct policy_handle *handle;/* [ref] */
		NTSTATUS result;
	} out;

};


struct lsa_Delete {
	struct {
		struct policy_handle *handle;/* [ref] */
	} in;

	struct {
		NTSTATUS result;
	} out;

};


struct lsa_EnumPrivs {
	struct {
		struct policy_handle *handle;/* [ref] */
		uint32_t max_count;
		uint32_t *resume_handle;UP_NAMES_FOREST_TRUSTS_ONLY ( 5 )
#define LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 ( 6 )
#define LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC ( 7 )
#endif
;

struct lsa_TranslatedName {
	enum lsa_SidType sid_type;
	struct lsa_String name;
	uint32_t sid_index;
};

struct lsa_TransNameArray {
	uint32_t count;/* [range(0,20480)] */
	struct lsa_TranslatedName *names;/* [size_is(count),unique] */
}/* [public] */;

struct lsa_LUIDAttribute {
	struct lsa_LUID luid;
	uint32_t attribute;
};

struct lsa_PrivilegeSet {
	uint32_t count;/* [range(0,1000)] */
	uint32_t unknown;
	struct lsa_LUIDAttribute *set;/* [size_is(count)] */
};

struct lsa_DATA_BUF {
	uint32_t length;
	uint32_t size;
	uint8_t *data;/* [length_is(length),size_is(size),unique] */
}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;

struct lsa_DATA_BUF2 {
	uint32_t size;/* [range(0,65536)] */
	uint8_t *data;/* [size_is(size),unique] */
}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;

enum lsa_TrustDomInfoEnum
#ifndef USE_UINT_ENUMS
 {
	LSA_TRUSTED_DOMAIN_INFO_NAME=(int)(1),
	LSA_TITY_POLICY_CHANGES ( 5 )
#define LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT ( 6 )
#define LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS ( 7 )
#define LSA_AUDIT_CATEGORY_ACCOUNT_LOGON ( 8 )
#endif
;

struct lsa_AuditEventsInfo {
	uint32_t auditing_mode;
	enum lsa_PolicyAuditPolicy *settings;/* [size_is(count),unique] */
	uint32_t count;
};

struct lsa_DomainInfo {
	struct lsa_StringLarge name;
	struct dom_sid2 *sid;/* [unique] */
};

struct lsa_PDAccountInfo {
	struct lsa_String name;
};

enum lsa_Role
#ifndef USE_UINT_ENUMS
 {
	LSA_ROLE_BACKUP=(int)(2),
	LSA_ROLE_PRIMARY=(int)(3)
}
#else
 { __do_not_use_enum_lsa_Role=INT_MAX}
#define LSA_ROLE_BACKUP ( 2 )
#define LSA_ROLE_PRIMARY ( 3 )
#endif
;

struct lsa_ServerRole {
	enum lsa_Role role;
};

struct lsa_ReplicaSourceInfo {
	struct lsa_String source;
	struct lsa_String account;
};

struct lsa_DefaultQuotaInfo {
	uint32_t paged_pool;
	uint32_t non_paged_pool;
	uint32_t min_wss;
	uint32_t max_wss;
	uint32_t pagefile;
	uint64_t unknown;
};

struct lsa_ModificationInfo imeout(struct dcerpc_binding_handle *h,
					   uint32_t timeout);

bool dcerpc_binding_handle_transport_encrypted(struct dcerpc_binding_handle *h);

NTSTATUS dcerpc_binding_handle_transport_session_key(
		struct dcerpc_binding_handle *h,
		TALLOC_CTX *mem_ctx,
		DATA_BLOB *session_key);

void dcerpc_binding_handle_auth_info(struct dcerpc_binding_handle *h,
				     enum dcerpc_AuthType *auth_type,
				     enum dcerpc_AuthLevel *auth_level);

NTSTATUS dcerpc_binding_handle_auth_session_key(
		struct dcerpc_binding_handle *h,
		TALLOC_CTX *mem_ctx,
		DATA_BLOB *session_key);

struct tevent_req *dcerpc_binding_handle_raw_call_send(TALLOC_CTX *mem_ctx,
						struct tevent_context *ev,
						struct dcerpc_binding_handle *h,
						const struct GUID *object,
						uint32_t opnum,
						uint32_t in_flags,
						const uint8_t *in_data,
						size_t in_length);
NTSTATUS dcerpc_binding_handle_raw_call_recv(struct tevent_req *req,
					     TALLOC_CTX *mem_ctx,
					     uint8_t **out_data,
					     size_t *out_length NT_STATUS_INVALID_EA_NAME
#define STATUS_SOME_UNMAPPED 		  NT_STATUS_SOME_NOT_MAPPED

#define NT_STATUS_ABIOS_NOT_PRESENT 		NT_STATUS(0xC0000000 | 0x010f)
#define NT_STATUS_ABIOS_LID_NOT_EXIST 		NT_STATUS(0xC0000000 | 0x0110)
#define NT_STATUS_ABIOS_LID_ALREADY_OWNED 	NT_STATUS(0xC0000000 | 0x0111)
#define NT_STATUS_ABIOS_NOT_LID_OWNER 		NT_STATUS(0xC0000000 | 0x0112)
#define NT_STATUS_ABIOS_INVALID_COMMAND 	NT_STATUS(0xC0000000 | 0x0113)
#define NT_STATUS_ABIOS_INVALID_LID 		NT_STATUS(0xC0000000 | 0x0114)
#define NT_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE 	NT_STATUS(0xC0000000 | 0x0115)
#define NT_STATUS_ABIOS_INVALID_SELECTOR 	NT_STATUS(0xC0000000 | 0x0116)

#define NT_STATUS_HANDLE_NOT_WAITABLE 		NT_STATUS(0xC0000000 | 0x0036)
#define NT_STATUS_DEVICE_POWER_FAILURE 		NT_STATUS(0xC0000000 | 0x009e)
#define NT_STATUS_VHD_SHARED			NT_STATUS(0xC05CFF0A)
#define NT_STATUS_SMB_BAD_CLUSTER_DIALECT	NT_STATUS(0xC05D0001)
#define NT_STATUS_NO_SUCH_JOB 			NT_STATUS(0xC0000000 | 0xEDE)

/*
                       --------svcctl_QueryServiceConfigEx *r);
void ndr_print_Opnum57NotUsedOnWire(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct Opnum57NotUsedOnWire *r);
void ndr_print_Opnum58NotUsedOnWire(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct Opnum58NotUsedOnWire *r);
void ndr_print_Opnum59NotUsedOnWire(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct Opnum59NotUsedOnWire *r);
void ndr_print_svcctl_CreateWowService(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct svcctl_CreateWowService *r);
void ndr_print_svcctl_OpenSCManager2(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct svcctl_OpenSCManager2 *r);
#endif /* _HEADER_NDR_svcctl */
/*
   Unix SMB/CIFS implementation.
   NT error code constants
   Copyright (C) Andrew Tridgell              1992-2000
   Copyright (C) John H Terpstra              1996-2000
   Copyright (C) Luke Kenneth Casson Leighton 1996-2000
   Copyright (C) Paul Ashton  31)

#define NDR_SVCCTL_CONTROLSERVICEEXA (0x32)

#define NDR_SVCCTL_CONTROLSERVICEEXW (0x33)

#define NDR_OPNUM52NOTUSEDONWIRE (0x34)

#define NDR_OPNUM53NOTUSEDONWIRE (0x35)

#define NDR_OPNUM54NOTUSEDONWIRE (0x36)

#define NDR_OPNUM55NOTUSEDONWIRE (0x37)

#define NDR_SVCCTL_QUERYSERVICECONFIGEX (0x38)

#define NDR_OPNUM57NOTUSEDONWIRE (0x39)

#define NDR_OPNUM58NOTUSEDONWIRE (0x3a)

#define NDR_OPNUM59NOTUSEDONWIRE (0x3b)

#define NDR_SVCCTL_CREATEWOWSERVICE (0x3c)

#define NDR_SVCCTL_OPENSCMANAGER2 (0x3d)

#define NDR_SVCCTL_CALL_COUNT (62)
void ndr_print_SERVICE_LOCK_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_LOCK_STATUS *r);
void ndr_print_svcctl_ServiceStatus(struct ndr_print *ndr, const char *name, enum svcctl_ServiceStatus r);
void ndr_print_svcctl_ControlsAccepted(struct ndr_print *ndr, const char *name, uint32_t r);
void ndr_print_SERVICE_STATUS(struct ndr_print *ndr, const char *name, const struct SERVICE_STATUS *r);
enum ndr_err_code ndr_push_SERVICE_STATUS_PROCESS(strucflags, uint32_t *r);
void ndr_print_svcctl_ServerType(struct ndr_print *ndr, const char *name, uint32_t r);
#endif /* _HEADER_NDR_misc */
/* header auto-generated by pidl */

#ifndef _PIDL_HEADER_misc
#define _PIDL_HEADER_misc

#include <stdint.h>


#ifndef _HEADER_misc
#define _HEADER_misc

#include <util/data_blob.h>

#define SV_TYPE_ALL	( 0xFFFFFFFF )
struct GUID {
	uint32_t time_low;
	uint16_t time_mid;
	uint16_t time_hi_and_version;
	uint8_t clock_seq[2];
	uint8_t node[6];
}/* [gensize,noprint,public] */;

struct ndr_syntax_id {
	struct GUID uuid;
	uint32_t if_version;
}/* [public] */;

struct policy_handle {
	uint32_t handle_type;
	struct GUID uuid;
}/* [public] */;

enum netr_SchannelType
#ifndef USE_UINT_ENUMS
 {
	SEC_CHAN_NULL=(int)(0),
	SEC_CHAN_LOCAL=(int)(1),
	SEC_CHAN_WKSTA=(int)(2),
	SEC_CHAN_DNS_DOMAIN=(int)(3),
	SEC_CHAN_DOMAIN=(int)(4),
	SEC_CHAN_LANMAN=(int)(5),
	SEC_CHAN_BDC=(int)(6),
	SEC_CHAN_RODC=(int)(7)
}
#else
 { __do_not_use_enum_netr_SchannelType=INT_MAX}
#define SEC_CHAN_NULL ( 0 )st_logon;
	NTTIME last_logoff;
	NTTIME acct_expiry;
	NTTIME last_password_change;
	NTTIME allow_password_change;
	NTTIME force_password_change;
	uint16_t logon_count;
	uint16_t bad_password_count;
	uint32_t acct_flags;
	uint32_t user_flags;
}/* [public] */;

struct auth_user_info_torture {
	uint32_t num_dc_sids;
	struct auth_SidAttr *dc_sids;/* [size_is(num_dc_sids)] */
}/* [public] */;

struct auth_user_info_unix {
	const char *unix_name;/* [charset(UTF8),unique] */
	const char *sanitized_username;/* [charset(UTF8),unique] */
}/* [public] */;

enum ticket_type
#ifndef USE_UINT_ENUMS
 {
	TICKET_TYPE_UNKNOWN=(int)(0),
	TICKET_TYPE_TGT=(int)(1),
	TICKET_TYPE_NON_TGT=(int)(2)
}
#else
 { __do_not_use_enum_ticket_type=INT_MAX}
#define TICKET_TYPE_UNKNOWN ( 0 )
#define TICKET_TYPE_TGT ( 1 )
#define TICKET_TYPE_NON_TGT ( 2 )
#endif
;

enum auth_group_inclusion
#ifndef USE_UINT_ENUMS
 {
	AUTH_GROUP_INCLUSION_INVALID=(int)(0),
	AUTH_INCLUDE_RESOURCE_GROUPS=(int)(2),
	AUTH_INCLUDE_RESOURCE_GROUPS_COMPRESSED=(int)(3),
	UTO_INHERITED ( 0x0800 )
#define SEC_DESC_DACL_PROTECTED ( 0x1000 )
#define SEC_DESC_SACL_PROTECTED ( 0x2000 )
#define SEC_DESC_RM_CONTROL_VALID ( 0x4000 )
#define SEC_DESC_SELF_RELATIVE ( 0x8000 )

struct security_descriptor {
	enum security_descriptor_revision revision;
	uint16_t type;
	struct dom_sid *owner_sid;/* [relative] */
	struct dom_sid *group_sid;/* [relative] */
	struct security_acl *sacl;/* [relative] */
	struct security_acl *dacl;/* [relative] */
}/* [flag(LIBNDR_FLAG_LITTLE_ENDIAN),gensize,nosize,public] */;

struct sec_desc_buf {
	uint32_t sd_size;/* [range(0,0x40000),value(ndr_size_security_descriptor(sd,ndr->flags))] */
	struct security_descriptor *sd;/* [subcontext(4),unique] */
}/* [public] */;

/* bitmap security_GroupAttrs */
#define SE_GROUP_MANDATORY ( 0x00000001 )
#define SE_GROUP_ENABLED_BY_DEFAULT ( 0x00000002 )
#define SE_GROUP_ENABLED ( 0x00000004 )
#define SE_GROUP_OWNER ( 0x00000008 )
#define SE_GROUP_USE_FOR_DENY_ONLY ( 0x00000010 )
#define SE_GROUP_INTEGRITY ( 0x00000020 )
#de" )
#define GUID_DRS_BEHAVIOR_VERSION	( "d31a8757-2447-4545-8081-3bb610cacbf2" )
struct dom_sid {
	uint8_t sid_rev_num;
	int8_t num_auths;/* [range(0,15)] */
	uint8_t id_auth[6];
	uint32_t sub_auths[15];
}/* [gensize,noprint,nopull,nopush,nosize,public] */;

enum implicit_owner_rights
#ifndef USE_UINT_ENUMS
 {
	IMPLICIT_OWNER_READ_CONTROL_RIGHTS,
	IMPLICIT_OWNER_READ_CONTROL_AND_WRITE_DAC_RIGHTS
}
#else
 { __do_not_use_enum_implicit_owner_rights=INT_MAX}
#define IMPLICIT_OWNER_READ_CONTROL_RIGHTS ( 0 )
#define IMPLICIT_OWNER_READ_CONTROL_AND_WRITE_DAC_RIGHTS ( 1 )
#endif
;

enum sec_privilege
#ifndef USE_UINT_ENUMS
 {
	SEC_PRIV_INVALID=(int)(0x0),
	SEC_PRIV_INCREASE_QUOTA=(int)(0x5),
	SEC_PRIV_MACHINE_ACCOUNT=(int)(0x6),
	SEC_PRIV_SECURITY=(int)(0x8),
	SEC_PRIV_TAKE_OWNERSHIP=(int)(0x09),
	SEC_PRIV_LOAD_DRIVER=(int)(0x0a),
	SEC_PRIV_SYSTEM_PROFILE=(int)(0x0b),
	SEC_PRIV_SYSTEMTIME=(int)(0x0c),
	SEC_PRIV_PROFILE_SINGLE_PROCESS=(int)(0x0d),
	SEC_PRIV_INCREASE_BASE_PRIORITY=(int)(0x0e),
	SEC_PRIV_CREATE_PAGEFILE
NTSTATUS claims_data_security_claims(TALLOC_CTX *mem_ctx,
				     struct claims_data *claims_data,
				     struct CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 **security_claims_out,
				     uint32_t *n_security_claims_out);

#endif /* _SAMBA_AUTH_SESSION_H */
/* header auto-generated by pidl */

#ifndef _PIDL_HEADER_security
#define _PIDL_HEADER_security

#include <stdint.h>


#include <gen_ndr/misc.h>
#define dom_sid2 dom_sid
#define dom_sid28 dom_sid
#define dom_sid0 dom_sid
#ifndef _HEADER_security
#define _HEADER_security

#define SEC_MASK_GENERIC	( 0xF0000000 )
#define SEC_MASK_FLAGS	( 0x0F000000 )
#define SEC_MASK_STANDARD	( 0x00FF0000 )
#define SEC_MASK_SPECIFIC	( 0x0000FFFF )
#define SEC_GENERIC_ALL	( 0x10000000 )
#define SEC_GENERIC_EXECUTE	( 0x20000000 )
#define SEC_GENERIC_WRITE	( 0x40000000 )
#define SEC_GENERIC_READ	( 0x80000000 )
#define SEC_FLAG_SYSTEM_SECURITY	( 0x01000000 )
#define SEC_FLAG_MAXIMUM_ALLOWED	( 0x02000000 )
#define SEC_STD_DELETE	( 0x00010000 )
#define SEC_STD_READ_CONTROL	( 0x00020D_SMBC_INTERFACE;
        } options DEPRECATED_SMBC_INTERFACE;

	/** INTERNAL DATA
	 * do _NOT_ touch this from your program !
	 */
	struct SMBC_internal_data * internal;
};


#endif /* SMBCLIENT_H_INCLUDED */
/*
   fork on steroids to avoid SIGCHLD and waitpid

   Copyright (C) Stefan Metzmacher 2010
   Copyright (C) Ralph Boehme 2017

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef LIB_UTIL_TFORK_H
#define LIB_UTcation),
        void *(*get_tls)(void *pkey,
                         const char *location)
        );



/**
 * @ingroup structure
 * Structure that contains a client context information
 * This structure is known as SMBCCTX
 *
 * DO NOT DIRECTLY MANIPULATE THE CONTEXT STRUCTURE!  The data in the context
 * structure should all be considered private to the library.  It remains here
 * only for backward compatibility.
 *
 * See the comments herein for use of the setter and getter functions which
 * should now be used for manipulating these values.  New features, functions,
 * etc., are not added here but rather in _internal where they are not
 * directly visible to applications.  This makes it much easier to maintain
 * ABI compatibility.
 */
struct _SMBCCTX
{
        /**
         * debug level
         *
         * DEPRECATED:
         * Use smbc_getDebug() and smbc_setDebug()
         */
        int     debug DEPRECATED_SMBC_INTERFACE;

        /**
         * netbios name used for making connections
       machine supports extended attributes if NTFS is used,
 *                  but not if FAT is used, and Windows 98 doesn't support
 *                  extended attributes at all.  Whether this is a feature or
 *                  a bug is yet to be decided.
 */
int smbc_llistxattr(const char *url,
                    char *list,
                    size_t size);

/**@ingroup attribute
 * List the supported extended attribute names associated with a file
 *
 * @param fd        A file descriptor associated with an open file (as
 *                  previously returned by smbc_open(), to get extended
 *                  attributes for.
 *
 * @param list      A pointer to a buffer in which the list of attributes for
 *                  the specified file or directory will be placed (unless
 *                  size is zero).
 *
 * @param size      The size of the buffer pointed to by list.  This parameter
 *                  may also be zero, in which case the size of the buffer
 *                  required to hold a    or one of the parameters is not of a correct
 *                            form
 *                  - ENOMEM No memory was available for internal needs
 *                  - EEXIST  If the attribute already exists and the flag
 *                            SMBC_XATTR_FLAG_CREAT was specified
 *                  - ENOATTR If the attribute does not exist and the flag
 *                            SMBC_XATTR_FLAG_REPLACE was specified
 *                  - EPERM   Permission was denied.
 *                  - ENOTSUP The referenced file system does not support
 *                            extended attributes
 *
 */
int smbc_getxattr(const char *url,
                  const char *name,
                  const void *value,
                  size_t size);


/**@ingroup attribute
 * Get extended attributes for a file.  The POSIX function which this maps to
 * would act on a symbolic link rather than acting on what the symbolic link
 * points to, but with no symbolic links in SMB file systems, this function
 * is    acl:<name or sid>
 *                     acl+:<name or sid>
 *
 *                  In the forms "system.nt_sec_desc.*" and
 *                  "system.nt_sec_desc.*+", the asterisk and plus signs are
 *                  literal, i.e. the string is provided exactly as shown, and
 *                  the value parameter should contain a complete security
 *                  descriptor with name:value pairs separated by tabs,
 *                  commas, or newlines (not spaces!).
 *
 *                  The plus sign ('+') indicates that SIDs should be mapped
 *                  to names.  Without the plus sign, SIDs are not mapped;
 *                  rather they are simply converted to a string format.
 *
 * @param value     The value to be assigned to the specified attribute name.
 *                  This buffer should contain only the attribute value if the
 *                  name was of the "system.nt_sec_desc.<attribute_name>"
 *                  form.  If the name was of the "system.nt_sec_desc.*" form  - EINVAL The client library is not properly initialized
 *                  - ENOMEM No memory was available for internal needs
 *                  - EPERM  Permission was denied.
 *
 */
int smbc_utime(const char *fname, struct utimbuf *utbuf);
#endif

/**@ingroup attribute
 * Set extended attributes for a file.  This is used for modifying a file's
 * security descriptor (i.e. owner, group, and access control list)
 *
 * @param url       The smb url of the file or directory to set extended
 *                  attributes for.
 *
 * @param name      The name of an attribute to be changed.  Names are of
 *                  one of the following forms:
 *
 *                     system.nt_sec_desc.<attribute name>
 *                     system.nt_sec_desc.*
 *                     system.nt_sec_desc.*+
 *
 *                  where <attribute name> is one of:
 *
 *                     revision
 *                     owner
 *                     owner+
 *                     group
 *                     group+
 *   t      Pointer to stat structure which will receive the
 *                  information. If this pointer is null the call
 *                  is identical to smbc_readdirplus.
 *
 * @return          A const pointer to a libsmb_file_info structure,
 *                  or NULL if an error occurs or end-of-directory is reached:
 *                  - EBADF Invalid directory handle
 *                  - EINVAL smbc_init() failed or has not been called
 *
 * @see             smbc_open(), smbc_readdir(), smbc_readdirplus2()
 */
const struct libsmb_file_info *smbc_readdirplus2(unsigned int dh,
					struct stat *st);

/**@ingroup directory
 * Get the current directory offset.
 *
 * smbc_telldir() may be used in conjunction with smbc_readdir() and
 * smbc_lseekdir().
 *
 * @param dh        Valid directory as returned by smbc_opendir()
 *
 * @return          The current location in the directory stream or -1
 *                  if an error occur.  The current location is not
 *                  an offset. Because of the whence);


/**@ingroup file
 * Close an open file handle.
 *
 * @param fd        The file handle to close
 *
 * @return          0 on success, < 0 on error with errno set:
 *                  - EBADF  fd isn't a valid open file descriptor
 *                  - EINVAL smbc_init() failed or has not been called
 *
 * @see             smbc_open(), smbc_creat()
 */
int smbc_close(int fd);


/**@ingroup directory
 * Unlink (delete) a file or directory.
 *
 * @param furl      The smb url of the file to delete
 *
 * @return          0 on success, < 0 on error with errno set:
 *                  - EACCES or EPERM Write  access  to the directory
 *                  containing pathname is not allowed or one
 *                  of  the  directories in pathname did not allow
 *                  search (execute) permission
 *                  - ENOENT A directory component in pathname does
 *                  not exist
 *                  - EINVAL NULL was passed in the file param or
 *		      smbc_init not called.
 *    etFunctionLseekdir(SMBCCTX *c, smbc_lseekdir_fn fn);

typedef int (*smbc_fstatdir_fn)(SMBCCTX *c,
                                SMBCFILE *dir,
                                struct stat *st);
smbc_fstatdir_fn smbc_getFunctionFstatdir(SMBCCTX *c);
void smbc_setFunctionFstatdir(SMBCCTX *c, smbc_fstatdir_fn fn);

#define SMBC_NOTIFY_ACTION_ADDED		1
#define SMBC_NOTIFY_ACTION_REMOVED		2
#define SMBC_NOTIFY_ACTION_MODIFIED		3
#define SMBC_NOTIFY_ACTION_OLD_NAME		4
#define SMBC_NOTIFY_ACTION_NEW_NAME		5
#define SMBC_NOTIFY_ACTION_ADDED_STREAM	6
#define SMBC_NOTIFY_ACTION_REMOVED_STREAM	7
#define SMBC_NOTIFY_ACTION_MODIFIED_STREAM	8

struct smbc_notify_callback_action {
	uint32_t action;
	const char *filename;
};

typedef int (*smbc_notify_callback_fn)(
	const struct smbc_notify_callback_action *actions,
	size_t num_actions, void *private_data);

typedef int (*smbc_notify_fn)(SMBCCTX *c, SMBCFILE *dir, smbc_bool recursive,
			      uint32_t completion_filter,
			      unsigned callback_timeout_ms,
			      smbc_n, smbc_bool b);

/**
 * @brief Set the 'client min protocol' and the 'client max protocol'.
 *
 * IMPORTANT: This overrides the values 'client min protocol' and 'client max
 * protocol' set in the smb.conf file!
 *
 * @param[in]  c  The smbc context to use.
 *
 * @param[in]  min_proto  The minimal protocol to use or NULL for leaving it
 *                        untouched.
 *
 * @param[in]  max_proto  The maximum protocol to use or NULL for leaving it
 *                        untouched.
 *
 * @returns true for success, false otherwise
 */
smbc_bool
smbc_setOptionProtocols(SMBCCTX *c, const char *min_proto, const char *max_proto);

/*************************************
 * Getters and setters for FUNCTIONS *
 *************************************/

/** Get the function for obtaining authentication data */
smbc_get_auth_data_fn smbc_getFunctionAuthData(SMBCCTX *c);

/** Set the function for obtaining authentication data */
void smbc_setFunctionAuthData(SMBCCTX *c, smbc_get_auth_data_fn fn);

/** Get the new-styhar * server,
					       const char * share, const char * workgroup,
                                               const char * username);

/**@ingroup callback
 * Remove a cached server
 *
 * @param c         pointer to smb context
 *
 * @param srv       pointer to server to remove
 *
 * @return          0 when found and removed. 1 on failure.
 *
 */
typedef int (*smbc_remove_cached_srv_fn)(SMBCCTX * c, SMBCSRV *srv);


/**@ingroup callback
 * Try to remove all servers from the cache system and disconnect
 *
 * @param c         pointer to smb context
 *
 * @return          0 when found and removed. 1 on failure.
 *
 */
typedef int (*smbc_purge_cached_fn)     (SMBCCTX * c);



/*****************************************
 * Getters and setters for CONFIGURATION *
 *****************************************/

/** Get the debug level */
int
smbc_getDebug(SMBCCTX *c);

/** Set the debug level */
void
smbc_setDebug(SMBCCTX *c, int debug);

/**
 * set log callback function to capture logs from libsmbclient, this
 * supported by system)
	 * Otherwise the value will be 0
	 */
	struct timespec btime_ts;
	/**
	 * Modified time for the file
	 */
	struct timespec mtime_ts;
	/**
	 * Access time for the file
	 */
	struct timespec atime_ts;
	/**
	 * Change time for the file
	 */
	struct timespec ctime_ts;
	/**
	 * Name of file
	 */
	char *name;
	/**
	 * Short name of file
	 */
	char *short_name;
};

/*
 * Logging callback function
 */
typedef void (*smbc_debug_callback_fn)(void *private_ptr, int level, const char *msg);

/*
 * Flags for smbc_setxattr()
 *   Specify a bitwise OR of these, or 0 to add or replace as necessary
 */
#define SMBC_XATTR_FLAG_CREATE       0x1 /* fail if attr already exists */
#define SMBC_XATTR_FLAG_REPLACE      0x2 /* fail if attr does not exist */


/*
 * Mappings of the DOS mode bits, as returned by smbc_getxattr() when the
 * attribute name "system.dos_attr.mode" (or "system.dos_attr.*" or
 * "system.*") is specified.
 */
#define SMBC_DOS_MODE_READONLY       0x01
#define SMBC_DOS_MODE_HIDDEN        eplicaObjectIdentifier3Binary_without_Binary(const struct drsuapi_DsReplicaObjectIdentifier3Binary *r, libndr_flags flags);


#endif /* _LIBRPC_NDR_NDR_DRSUAPI_H */
/* header auto-generated by pidl */

#include <ndr.h>
#include <gen_ndr/nbt.h>

#ifndef _HEADER_NDR_nbt
#define _HEADER_NDR_nbt

#include <ndr/ndr_nbt.h>
#define NDR_NBT_UUID "6def41b6-86e4-4c32-997c-ed33af7bcd8e"
#define NDR_NBT_VERSION 0.0
#define NDR_NBT_NAME "nbt"
#define NDR_NBT_HELPSTRING "NBT messages"
extern const struct ndr_interface_table ndr_table_nbt;
#define NDR_NBT_CALL_COUNT (0)
void ndr_print_nbt_operation(struct ndr_print *ndr, const char *name, uint16_t r);
void ndr_print_nbt_name_type(struct ndr_print *ndr, const char *name, enum nbt_name_type r);
enum ndr_err_code ndr_push_nbt_name(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct nbt_name *r);
enum ndr_err_code ndr_