CryptoSys PKI Pro Manual

PKI_ModuleName

Retrieves the name of the current process's module.

VBA/VB6 Syntax

Public Declare Function PKI_ModuleName Lib "diCrPKI.dll" (ByVal strName As String, ByVal nStrLen As Long, ByVal nOptions As Long) As Long

nRet = PKI_ModuleName(strName, nStrLen, 0)

C/C++ Syntax

long __stdcall PKI_ModuleName(char *szOutput, long nOutChars, long nOptions);

Parameters

szOutput
[out] to receive the name of the module.
nOutChars
[in] specifying the maximum length of the string to be copied.
nOptions
[in] option flags: not used in this release. Specify zero.

Returns (VBA/C)

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

VBA Wrapper Syntax

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

.NET Equivalent

General.ModuleName Method

C++ (STL) Equivalent

static std::string dipki::Gen::ModuleName ()

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. ANSI C users must add one to this value when allocating memory.

If using the Win32 DLL in the system folder on a 64-bit system, Windows will return "C:\WINDOWS\SYSTEM32\diCrPKI.dll" when the DLL file path is actually "C:\WINDOWS\SYSWOW64\diCrPKI.dll". Use PKI_Platform to find out exactly which DLL is being used.

Example (VBA core function)

Dim nLen As Long
Dim strModuleName As String

nLen = PKI_ModuleName("", 0, 0)
If nLen > 0 Then
    strModuleName = String(nLen, " ")
    nLen = PKI_ModuleName(strModuleName, nLen, 0)
    strModuleName = Left(strModuleName, nLen)
    Debug.Print "PKI_ModuleName returns " & nLen & " [" & strModuleName & "]"
Else
    Debug.Print "Error " & nLen & " with PKI_ModuleName"
End If

On our W10 system, this produces the output:

PKI_ModuleName returns 31 [C:\WINDOWS\SYSTEM32\diCrPKI.dll]

Example (VBA wrapper function)

Debug.Print pkiCompileTime()
Debug.Print pkiModuleInfo()
Debug.Print pkiModuleName()
Debug.Print pkiPlatform()

See Also

PKI_Platform

[Contents] [Index]

[PREV: PKI_ModuleInfo...]   [Contents]   [Index]   
   [NEXT: PKI_Platform...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.