串口上位机中,调用WriteFile()函数中参数设置问题

1、在一段串口上位机的代码中,调用了WriteFile()函数,其中倒数第二个参数赋值为-1。如下面代码:
void SerialPutc(HANDLE hCom , char txchar)
{
BOOL bWriteRC;
static DWORD iByteWritten = -1 ;
bWriteRC = WriteFile( hCom , &txchar , 1 , &iByteWritten , NULL );
return;
}

-1是代表EOF,但在WriteFile()函数中,倒数第二个参数代表已写入的字节数。此处为何要把iByteWritten这个参数赋值为-1 ?

2、与第1个问题类似,调用了ReadFile()函数,其中倒数第二个参数赋值为-1。如下面代码:
void SerialGetc(HANDLE hCom , char txchar)
{
BOOL bReadRC;
char ret[4] ;
static DWORD iBytesRead = -1 ;
bReadRC = ReadFile( hCom , ret , 1 , &iBytesRead , NULL );
return ret[0];
}
此处为何要把 iBytesRead这个参数赋值为-1 ?

这个-1不是赋值,是初始值,只是第一次运行时有效。