Meglio se non usi la stessa variabile.
Il perché è scritto qui:codice:DWORD res=0; WriteFile(h,buf,write,&res,NULL)
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
lpNumberOfBytesWritten [out, optional]
A pointer to the variable that receives the number of bytes written when using a synchronous hFile parameter. WriteFile sets this value to zero before doing any work or error checking. Use NULL for this parameter if this is an asynchronous operation to avoid potentially erroneous results.

Rispondi quotando