First function definition:
ms opendocs here:
create the function signature NET_API_STATUS NetrSessionEnum( SRVSVC_HANDLE ServerName, WCHAR* ClientName, WCHAR* UserName, PSESSION_ENUM_STRUCT InfoStruct, DWORD PreferedMaximumLength, DWORD* TotalEntries, DWORD* ResumeHandle)
For this cast to work you need to import two structs:
union SESSION_ENUM_UNION
{
void *level;
};
When you're this many structs down, its ok to simplify and then worry about it more/revise if stuff is messed up later because of it
typedef struct _SESSION_ENUM_STRUCT {
DWORD Level;
SESSION_ENUM_UNION SessionInfo;
} SESSION_ENUM_STRUCT,
*PSESSION_ENUM_STRUCT,
*LPSESSION_ENUM_STRUCT;
End up with this:
DWORD NetrSessionEnum( wchar_t* ServerName, WCHAR* ClientName, WCHAR* UserName, PSESSION_ENUM_STRUCT InfoStruct, DWORD PreferedMaximumLength, DWORD* TotalEntries, DWORD* ResumeHandle)
Some of the more specific types have to be replaced, such as ServerName
with the underlying data type (SRVSVC_HANDLE -> wchar_t*). Google these to find their underlying types
int __stdcall NetpAccessCheckAndAuditEx(LPTSTR SubsystemName, LPTSTR ObjectTypeName, PSECURITY_DESCRIPTOR SecurityDescriptor, ACCESS_MASK DesiredAccess, PGENERIC_MAPPING GenericMapping);
NTSTATUS __stdcall NtAccessCheckAndAuditAlarm(PUNICODE_STRING SubsystemName, PVOID HandleId, PUNICODE_STRING ObjectTypeName, PUNICODE_STRING ObjectName, PSECURITY_DESCRIPTOR SecurityDescriptor, ACCESS_MASK DesiredAccess, PGENERIC_MAPPING GenericMapping, BOOLEAN ObjectCreation, PACCESS_MASK GrantedAccess, PNTSTATUS AccessStatus, PBOOLEAN GenerateOnClose);