buffer.h
========
int evbuffer_add_file(
struct evbuffer *outbuf,
int fd,
ev_off_t offset,
ev_off_t length);
========
int evbuffer_add_file(
struct evbuffer *outbuf,
int fd,
ev_off_t offset,
ev_off_t length);
usually we assume 4 arguments = 4 DWORD but not in this case.
util.h
======
#ifdef WIN32
#define ev_off_t ev_int64_t
#else
#define ev_int64_t signed __int64
======
#ifdef WIN32
#define ev_off_t ev_int64_t
#else
#define ev_int64_t signed __int64
see that, these ev_off_t is 64 bits (QUADWORD), damn it,
so, the proper way to call this function would be
mov eax,[efilelen]
cdq
push edx eax
push 0 0
cinvoke evbuffer_add_file,[ebuffer],[efileh]
cdq
push edx eax
push 0 0
cinvoke evbuffer_add_file,[ebuffer],[efileh]
Labels: fasm, libevent, programming
Post a Comment