GW2FileErrorMsg
GW2FileErrorMsg function दिए गए session ID के लिए Glasswall द्वारा reported error message को retrieve करता है। Error message को एक output buffer में रखा जाता है।
यदि error के लिए एक से अधिक कारण थे, तो इस function call द्वारा केवल एक ही report किया जाएगा। यदि failure के लिए details आवश्यक हैं, तो वे उस analysis report में मौजूद होंगी जो तब produce होती है जब GW2RegisterAnalysisFile या GW2AnalysisRegisterMemory में से किसी एक function को session पर call किया गया हो। यदि नहीं, तो विस्तृत analysis report produce करने के लिए document को किसी अन्य session में इन्हीं functions में से किसी एक का उपयोग करके Glasswall द्वारा process किया जा सकता है।
- C++
- C#
- Java
- Python
- JavaScript
सारांश
#include "glasswall.core2.api.h"
// The **GW2FileErrorMsg** function retrieves the error message reported by Glasswall.
// A pointer to the error message is placed in the object pointed to by **errorMsgBuffer**
// and the size, in bytes, of the error message is placed in the **size_t** object
// pointed to by **errorMsgBufferLength**.
int GW2FileErrorMsg(
Session session,
char **errorMsgBuffer,
size_t *errorMsgBufferLength);
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
सारांश
/// <summary>
///
/// </summary>
/// <param name="session">Session ID number</param>
/// <param name="outputBuffer">Location in memory where the error message will be placed</param>
/// <param name="bufferLength">Size of the output buffer</param>
public int FileErrorMsg(
int session,
out IntPtr outputBuffer,
ref UIntPtr bufferLength)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
सारांश
import com.glasswall.core2javabridge.*;
public String GW2FileErrorMsgString(int session) throws GlasswallException
नोट
The GW2FileErrorMsgString function parameters have been updated to use String in place of byte[], and to remove the need to call GetErrorBuffer to retrieve the data. The original functions have been deprecated.
रिटर्न
GW2FileErrorMsgString session error messages को शामिल करने वाला एक String return करता है। यदि retrieve करने के लिए कोई error messages नहीं हैं, तो String खाली होगा।
A GlasswallException exception will be thrown if session is invalid, or if the error message could not be retrieved.
सारांश - अप्रचलित फ़ंक्शन
import com.glasswall.core2javabridge.*;
(Deprecated)
public int GW2FileErrorMsg(int session) throws GlasswallException
public byte[] GetErrorBuffer(int session) throws GlasswallException
विवरण
GW2FileErrorMsg फ़ंक्शन session द्वारा निर्दिष्ट सत्र के लिए फ़ाइल त्रुटि संदेश को एक आंतरिक बफ़र में आउटपुट करता है। त्रुटि संदेश डेटा प्राप्त करने के लिए GW2RunSession को कॉल करने के बाद GetErrorBuffer को कॉल करें।
format के लिए मान्य enumerators हेतु API Overview/Return types देखें।
रिटर्न्स - अप्रचलित फ़ंक्शन
GW2FileErrorMsg फ़ंक्शन GW2_RetStatus enumeration को int में परिवर्तित करके लौटाता है। यदि कोई त्रुटि हुई है तो मान ऋणात्मक होगा। 0 सफलता को दर्शाता है। विवरण के लिए API Overview/Return types देखें।
GetErrorBuffer फ़ंक्शन त्रुटि विवरण वाला एक byte array लौटाता है। यदि GW2FileErrorMsg को कॉल नहीं किया गया है, तो यह null होगा।
A GlasswallException exception will be thrown if session is invalid, or if the error message could not be retrieved.
सारांश
Glasswall Session Process त्रुटि संदेश प्राप्त करें।
def file_error_message(self, session: int) -> str:
""" Retrieve the Glasswall Session Process error message.
Args:
session (int): The session integer.
Returns:
error_message (str): The Glasswall Session Process error message.
"""
रिटर्न
एक string के रूप में त्रुटि संदेश।
सारांश
/**
* This function retrieves the error message reported by Glasswall. If more than one error
* is reported, the last one will be returned.
*
*/
GW2FileErrorMsg(
session,
errorMsgBuffer,
errorMsgBufferLength)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
उदाहरण
function getFileErrorMsg(session_id, gw) {
/*
GW2FileErrorMsg API signature
int GW2FileErrorMsg(
Session session,
char **errorMsgBuffer,
size_t *errorMsgBufferLength
);
*/
// allocate pointer space to store the pointer to the message buffer
let CString_ptr = ref.refType(ref.types.CString);
let errorMsgBuffer = ref.alloc(CString_ptr);
// allocate space to store the buffer length; use .deref() to extract it
let errorMsgBufferLength = ref.alloc('size_t');
let rv = gw.GW2FileErrorMsg(session_id, errorMsgBuffer, errorMsgBufferLength);
buf_len = errorMsgBufferLength.deref();
if (buf_len == 0)
arr_buf = "";
else
arr_buf = buffer_to_array(errorMsgBuffer, errorMsgBufferLength);
let message = `\n GW2FileErrorMsg:return=${rv}`;
message += "\n errorMsgBuffer = \"" + arr_buf.toString() + '"';
message += `\n errorMsgBufferLength = ${buf_len}`;
return message;
}