LogCloseFile

LogCloseFile closes a file that was previously opened by LogOpenFile.

Syntax
LogCloseFile(service, pCloseFile);

Parameters

 * service (ULONG) - input : The class of Logging Service:
 * Error logging
 * All other values are reserved for future use.


 * pCloseFile (PVOID) - input : A pointer to the LogCloseFile parameter packet.
 * For Error Logging, this is a pointer to a LCFREQUEST structure.

Returns

 * rc (APIRET) - returns : Return code.


 * LogCloseFile returns one of the following values:


 * 0 No error
 * 520 Error LF buf too small
 * 5 Error access denied
 * 523 Error LF invalid service
 * 1703 Invalid data pointer
 * 1701 Invalid LF log file id
 * 1702 Invalid LF packet revision number
 * 1703 Invalid data pointer
 * 1706 Invalid LF parm packet ptr
 * 1761 Error LF invalid packet size

Remarks
The library LFAPI.LIB must be linked with object files that use LogCloseFile

Example Code

 * 1) define INCL_LOGGING
 * 2) include 
 * 3) include 

ULONG    service; PVOID    pCloseFile; APIRET   rc;

rc = LogCloseFile(service, pCloseFile);  The following example closes a log file (log_file_ID = 2) that was opened with LogOpenFile.

 #define INCL_LOGGING #include  #include   #include   #include 

{ APIRET rc;                            /* return code */ ULONG service; LCFREQUEST close_file_packet;

service = ERROR_LOGGING_SERVICE;

/* Construct the LogOpenFile parameter packet */ close_file_packet.packet_size = sizeof(LCFREQUEST); close_file_packet.packet_revision_number = LF_UNI_API; close_file_packet.log_file_ID = 2;

rc = LogCloseFile(service,                          /* service */                     &close_file_packet)           /* parameter packet  */ if (rc |= 0) {  printf("LogCloseFile error: return code = %d",rc); return; } 

Related

 * LogOpenFile
 * LLogReadEntry