FNOPEN マクロ (fdi.h)
FNOPEN マクロは、FDI コンテキストでファイルを開くために、アプリケーション定義のコールバック関数の宣言を提供します。
構文
void FNOPEN(
[in] fn
);
パラメーター
[in] fn
ファイルの名前です。
戻り値
なし
解説
関数は、 _openのようなパラメーターを受け取ります。
例
FNOPEN(fnFileOpen)
{
HANDLE hFile = NULL;
DWORD dwDesiredAccess = 0;
DWORD dwCreationDisposition = 0;
UNREFERENCED_PARAMETER(pmode);
if ( oflag & _O_RDWR )
{
dwDesiredAccess = GENERIC_READ | GENERIC_WRITE;
}
else if ( oflag & _O_WRONLY )
{
dwDesiredAccess = GENERIC_WRITE;
}
else
{
dwDesiredAccess = GENERIC_READ;
}
if ( oflag & _O_CREAT )
{
dwCreationDisposition = CREATE_ALWAYS;
}
else
{
dwCreationDisposition = OPEN_EXISTING;
}
hFile = CreateFileA(pszFile,
dwDesiredAccess,
FILE_SHARE_READ,
NULL,
dwCreationDisposition,
FILE_ATTRIBUTE_NORMAL,
NULL);
return (INT_PTR)hFile;
}
要件
対象プラットフォーム | Windows |
ヘッダー | fdi.h |