//write file
//
//note :
//data : dword : uint
//写 文件
//
//注意 :
//数据 : 双字节 : 没有 符号的 整数
DWORD ZFWRITEFILE_VERSION_DWORD_VERSION_UINT (
PBYTE & z_writefileversiondwordversionuint_pathfilenameextension ,
//input :
//path + file name + extension
//路径 + 文件名 + 扩展名
DWORD & z_writefileversiondwordversionuint_nbytemove ,
//input :
//n byte move
//n 字节 移动
DWORD & z_writefileversiondwordversionuint_integerdword
//input :
//integer : dword
//整数 : 双字节
)
//write file
//
//note :
//data : dword : uint
//写 文件
//
//注意 :
//数据 : 双字节 : 没有 符号的 整数
{
z_writefileversiondwordversionuint_hfile = CreateFile (
(LPCSTR)z_writefileversiondwordversionuint_pathfilenameextension ,
//name of file to create
//文件名 ,之后用于 创建
GENERIC_WRITE ,
//Write access
//写入 权利
0 ,
//not share
//不共享
NULL ,
//default security
//默认 安全
CREATE_NEW ,
//create new file if not exist
//创建新文件,如果不存在
FILE_ATTRIBUTE_NORMAL ,
//normal file
//通常 文件
NULL
//no template
//没有 模板
) ;
//create file
//创建 文件
SetFilePointer (
z_writefileversiondwordversionuint_hfile ,
//file handle
//文件 句柄
z_writefileversiondwordversionuint_nbytemove ,
//n byte move : ( low order 32-bits of a signed value )
//n 字节 移动 : ( 低位的 32位 ,有符号的数值 : 共 64位 )
0 ,
//high order 32-bits of the signed 64-bit distance to move
//高位的 32位 用于移动 : 共 64位 : 有符号 数值
FILE_BEGIN
//file begin
//文件 开始
) ;
//move file pointer
//移动 文件 指针
z_writefileversiondwordversionuint_integerdword_version_uint = z_writefileversiondwordversionuint_integerdword ;
//integer : uint
//整数 : 没有符号的 整数
WriteFile (
z_writefileversiondwordversionuint_hfile ,
//file handle
//文件 句柄
& z_writefileversiondwordversionuint_integerdword_version_uint ,
//buffer pointer to write
//缓冲 指针 ,用于 写入
z_writefileversiondwordversionuint_bytewritecount ,
//byte number to write
//字节 数量 用于 写入
& z_writefileversiondwordversionuint_bytewritecount_receive ,
//receice : byte number to write
//收到 : 字节 数量 用于 写入
NULL
// no overlapped structure
//没有 层叠 结构
) ;
//write data
//写入 数据
CloseHandle (
z_writefileversiondwordversionuint_hfile
//handle
//句柄
) ;
//close handle
//关闭 句柄
return 0 ;
//funtion success
//函数成功
}
///////
//ZFWRITEFILE_VERSION_DWORD_VERSION_UINT function
//write file
//
//note :
//data : dword : uint
//ZFWRITEFILE_VERSION_DWORD_VERSION_UINT 函数
//写 文件
//
//注意 :
//数据 : 双字节 : 没有 符号的 整数
static HANDLE z_writefileversiondwordversionuint_hfile ;
//file handle
//文件 句柄
static UINT z_writefileversiondwordversionuint_integerdword_version_uint ;
//integer : uint
//整数 : 没有符号的 整数
static DWORD z_writefileversiondwordversionuint_bytewritecount = 4 ;
//byte number to write
//字节 数量 用于 写入
static DWORD z_writefileversiondwordversionuint_bytewritecount_receive ;
//receice : byte number to write
//收到 : 字节 数量 用于 写入
没有评论:
发表评论