GW2RegisterOutFile
GW2RegisterOutFile 関数は、Glasswall によって生成される管理済みファイルの出力先を登録します。この関数を使用すると、そのセッションで Manage & Protect Process Mode が有効になります。
- C++
- C#
- Java
- Python
- JavaScript
概要
セッション session に対して、GW2RegisterOutFile 関数は、outputFileBuffer が指す文字列を名前とするファイルを、Glasswall によって生成される管理済みファイルの出力先ファイルとして登録します。パスのベース名は、GW2RegisterInputFile 関数を使用して登録したベース名と異なっている必要があります。この関数を使用すると、そのセッションで Manage & Protect Process Mode が有効になります。
#include "glasswall.core2.api.h"
int GW2RegisterOutFile(Session session, const char *outputFilePath);
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。
例
#include "glasswall.core2.api.h"
HANDLE session = GW2OpenSession();
if (!session)
/* deal with error */
else
{
if (GW2RegisterOutFile(session, "managed_file.docx") < 0)
/* deal with error */
else
/* continue processing */
...
}
/* later */
if (GW2CloseSession(session) < 0)
/* error closing session */
概要
public int RegisterOutFile(
int session,
string outputFilePath)
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。
概要
import com.glasswall.core2javabridge.*;
public int GW2RegisterOutFile(int session, String outputFilePath) throws GlasswallException, NullPointerException
(Deprecated)
public int GW2RegisterOutFile(int session, byte[] outputFilePath) throws GlasswallException, NullPointerException
注
The GW2RegisterOutFile function parameters have been updated to use String in place of byte[]. The original function has been deprecated.
戻り値
GW2RegisterOutFile 関数は、GW2_RetStatus 列挙型を int に変換して返します。エラーが発生した場合、値は負になります。0 は成功を示します。詳細については API Overview/Return types を参照してください。
NullPointerException 例外は、outputFilePath が null または空の場合にスローされます。
A GlasswallException exception will be thrown if session is invalid, if the outputFilePath could not be retrieved, or if the outputFilePath could not be converted to UTF-8.
概要
指定されたセッションに対して出力ファイルを登録します。output_file が None の場合、ファイルは 'buffer' および 'buffer_length' 属性として返されます。
def register_output(self, session, output_file: Optional[str] = None):
""" Register an output file for the given session. If output_file is None the file will be returned as 'buffer' and 'buffer_length' attributes.
Args:
session (int): The session integer.
output_file (Optional[str]): If specified, during run session the file will be written to output_file, otherwise the file will be written to the glasswall.GwReturnObj 'buffer' and 'buffer_length' attributes.
Returns:
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attribute 'status' indicating the result of the function call. If output_file is None (memory mode), 'buffer', and 'buffer_length' are included containing the file content and file size.
"""
戻り値
gw_return_object (glasswall.GwReturnObj): 関数呼び出しの結果を示す属性 'status' を持つ GwReturnObj インスタンスです。output_file が None(メモリモード)の場合、ファイル内容とファイルサイズを含む 'buffer' および 'buffer_length' が含まれます。
status 属性は整数の GW2_RetStatus enum 値です。負の数は失敗を示します。
概要
この関数は、Glasswall によって生成された managed file の宛先ファイルを登録します。
/**
* @param {number} session The ID of the session.
* @param {string} outputFilePath The specified output path. Must be different to the specified input file path.
*/
GW2RegisterOutFile(
session,
outputFilePath)
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。