CryptoSys API Library Manual

API_ModuleName

Retrieves the name of the current process's module.

VBA/VB6 Syntax

Public Declare Function API_ModuleName Lib "diCryptoSys.dll" (ByVal strModuleName As String, ByVal nMaxChars As Long, ByVal nOptions As Long) As Long

nRet = API_ModuleName(strName, nStrLen, 0)

C/C++ Syntax

long __stdcall API_ModuleName(char *szOutput, long nMaxChars, long nOptions);

Parameters

szOutput
[out] to receive the name of the module.
nMaxChars
[in] specifying the maximum number of characters to be received.
nOptions
[in] option flags: API_GEN_PLATFORM to get the platform name, either "Win32" or "X64".

Returns (VBA/C)

If successful, the return value is the number of characters in the output string; otherwise it returns a negative error code.

VBA Wrapper Syntax

Public Function apiModuleName(Optional nOptions As Long = 0) As String

.NET Equivalent

General.ModuleName Method

COM/ASP Equivalent

gen.ModuleName
Public Function ModuleName() As String

See gen.ModuleName.

C++ (STL) Equivalent

static std::string crsysapi::Gen::ModuleName ()
static std::string crsysapi::Gen::Platform ()

Python Equivalent

static Gen.module_name()

Remarks

For the "raw" VBA/C function, the user must allocate an output string buffer szOutput of the required length. Specify a zero nOutChars or an empty string for szOutput to find the required length of the output string. C/C++ users must add one to this value when allocating memory.

Example (VBA core function)

Dim nChars As Long
Dim strModuleName As String

nChars = API_ModuleName("", 0, 0)
Debug.Assert nChars > 0
strModuleName = String(nChars, " ")
nChars = API_ModuleName(strModuleName, nChars, 0)
Debug.Print strModuleName   ' C:\WINDOWS\SYSTEM32\diCryptoSys.dll

Example (VBA wrapper function)

Debug.Print "ModuleName= " & apiModuleName()

See Also

[Back to Top]

[PREV: API_ModuleInfo...]   [Contents]   [Index]   
   [NEXT: API_Platform...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.