Advertisement
7_2009-2012 Windows API Call/ Explanation #218796

Api Any Calls/Declarations

This is not really a code contribution, but a small tip on API parameter lists. Ever seen an Api Function which expects parameters of type 'Any' ? . For example domain/user maintenance calls in the Nt Networking Api or similar (Add Users/Groups etc..). These parameters usually (in the C/C++ base code) are probably expecting string pointers , an other example is in the case of the AddGroup Api call in the NetApi.Dll, where it expects the name of the server in one of the parameters in the list. How you actually pass the pointer is by:- eg. '### ' Api Function for example:- ' ApiFunction(sArgument as Any) As Long ' Dim strAnyString As String Dim strPass() As Byte Dim lRet As Long strAnyString = "String as argument" strPass = strAnyString lRet = ApiFunction(strPass(0)) '### What we're basically doing is getting the string to pass, assigning it to another variable array of type 'byte', then passing the first array segment to the Api function. Easy enough? Hope you understood all that ! Robert Dick

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
#
Original Comments (3)
Recovered from Wayback Machine