PP_COPYADD()

Adds the current computer to the list of valid computers

Applies to:

Win32, Win64

Syntax-VB:

Declare Function pp_copyadd(ByVal handle As Long, ByVal flags As Long, ByVal comp_num As Long) As Long

Syntax-C:

LONG pp_copyadd(PPLFHANDLE handle, LONG flags, LONG comp_num)

Arguments:

<handle> is the handle to the License File given by pp_lfopen()

<flags> sets miscellaneous options, defined as:

COPYADD_ENHANCED [4] - adds the current Computer ID to the license file using the Enhanced Computer ID Algorithms.

COMPNO_NO_WMI [262144] - used in conjunction with the COPYADD_ENHANCED flag when protecting a DLL to suppress WMI data, which causes the application to hang. Note, when using this flag it must also be in any call to pp_compno(), pp_copycheck() or pp_copycheckth().

<comp_num> Not used.  Set to 0.

Returns:

Refer to pp_errorstr() for a table of possible return codes and their meaning. Typically, PP_SUCCESS [1] (ID was added) is returned.

Description:

Adds the current Computer ID to the license file using the Enhanced Computer ID Algorithms. If a Computer ID is already in the license file it will be replaced with the current Computer ID.  Only one Computer ID may be in the license file at a time.

The License File variable VAR_AUTHORIZED_COMPS will be set to 1.

Example:

' Authorize this computer.

Dim result As Long

 

result = pp_copyadd(lfhandle, COPYADD_ENHANCED, 0)

 

If result = PP_SUCCESS Then

 ' This computer is now authorized which means that a

 ' call to pp_copycheck will return PP_SUCCESS

End If

See Also:

PP_LFOPEN(), PP_COPYCHECK(), PP_COPYDELETE(), and PP_COMPNO()

Concept Link IconRelated Topics