This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

optimization/3480: gcc-3.0, bad code generated with -O3 -fomit-frame-pointer on intel x86 <synopsis of the problem (one line)>



>Number:         3480
>Category:       optimization
>Synopsis:       gcc-3.0, bad code generated with -O3 -fomit-frame-pointer on intel x86
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 29 08:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Juergen Keil
>Release:        3.0
>Organization:
Tools GmbH 
>Environment:
System: SunOS elise 5.8 Generic_108529-07 i86pc i386 i86pc
Architecture: i86pc

	
host: i386-pc-solaris2.8
build: i386-pc-solaris2.8
target: i386-pc-solaris2.8
configured with: ../gcc-3.0/configure --prefix=/usr/local/gcc-3.0 --with-as=/opt/sfw/bin/gas --enable-languages=c,c++ : (reconfigured) ../gcc-3.0/configure --prefix=/usr/local/gcc-3.0 --with-as=/opt/sfw/bin/gas --enable-languages=c,c++
>Description:
	
gcc-3.0 produces buggy code for acmStreamOpen() with
"-O3 -fomit-frame-pointer" or "-O2 -fomit-frame-pointer
-finline-functions -frename-registers" (code is OK with sole -O2),
the bad code accesses parameters via %ebp without setting up a
propper %ebp first!
>How-To-Repeat:
	
Compile the appended "afl.i" with "gcc -O3 -fomit-frame-pointer -S afl.i",
and inspect the assembler code generated for function "acmStreamOpen".
It contains a printf call right at the start; the printf prints the
value of one of the function's parameters.  The function parameter is accessed
via the %ebp register,  but apparently the %ebp register has been optimized out
of this function, that is, a new stack frame was not setup and register %ebp is
*not* properly initialized (the correct code should access the parameter as
offset(%esp)).

Here's the buggy assembler code, with a comment from me:

.globl acmStreamOpen
        .type   acmStreamOpen,@function
acmStreamOpen:
        pushl   %ebp
        pushl   %edi
        pushl   %esi
        pushl   %ebx
        subl    $96, %esp
        movl    12(%ebp), %esi	<--- accesses pwfxSrc as offset(%ebp), no
				<--- valid %ebp setup yet!
        movzwl  16(%esi), %edx
        movl    16(%ebp), %ebx
        pushl   %edx
        pushl   %esi
        pushl   $.LC6
        call    printf

====== afl.i =================================================================
typedef __builtin_va_list __gnuc_va_list;
#pragma ident "@(#)stdio.h	1.78	99/12/08 SMI"

#pragma ident "@(#)stdio_iso.h	1.2	99/10/25 SMI"


#pragma ident "@(#)feature_tests.h	1.18	99/07/26 SMI"

#pragma ident "@(#)isa_defs.h	1.20	99/05/04 SMI"
#pragma ident "@(#)va_list.h	1.12	99/05/04 SMI"
typedef void *__va_list;
#pragma ident "@(#)stdio_tag.h	1.3	98/04/20 SMI"
typedef struct __FILE __FILE;
#pragma ident "@(#)stdio_impl.h	1.8	99/06/10 SMI"

typedef int ssize_t;
struct __FILE
{




        ssize_t _cnt;
        unsigned char *_ptr;

        unsigned char *_base;
        unsigned char _flag;
        unsigned char _file;
        unsigned __orientation:2;
        unsigned __ionolock:1;
        unsigned __filler:5;
};
typedef long long __longlong_t;
typedef __FILE FILE;







typedef unsigned int size_t;




typedef long fpos_t;
extern __FILE __iob[60];
extern int remove(const char *);
extern int rename(const char *, const char *);
extern FILE *tmpfile(void);
extern char *tmpnam(char *);
extern int fclose(FILE *);
extern int fflush(FILE *);
extern FILE *fopen(const char *, const char *);
extern FILE *freopen(const char *, const char *, FILE *);
extern void setbuf(FILE *, char *);
extern int setvbuf(FILE *, char *, int, size_t);

extern int fprintf(FILE *, const char *, ...);

extern int fscanf(FILE *, const char *, ...);

extern int printf(const char *, ...);

extern int scanf(const char *, ...);

extern int sprintf(char *, const char *, ...);

extern int sscanf(const char *, const char *, ...);
extern int vfprintf(FILE *, const char *, __va_list);
extern int vprintf(const char *, __va_list);
extern int vsprintf(char *, const char *, __va_list);
extern int fgetc(FILE *);
extern char *fgets(char *, int, FILE *);
extern int fputc(int, FILE *);
extern int fputs(const char *, FILE *);


extern int getc(FILE *);
extern int putc(int, FILE *);



extern int getchar(void);
extern int putchar(int);

extern char *gets(char *);
extern int puts(const char *);
extern int ungetc(int, FILE *);
extern size_t fread(void *, size_t, size_t, FILE *);
extern size_t fwrite(const void *, size_t, size_t, FILE *);
extern int fgetpos(FILE *, fpos_t *);
extern int fseek(FILE *, long, int);
extern int fsetpos(FILE *, const fpos_t *);
extern long ftell(FILE *);
extern void rewind(FILE *);


extern void clearerr(FILE *);
extern int feof(FILE *);
extern int ferror(FILE *);

extern void perror(const char *);


extern int __filbuf(FILE *);
extern int __flsbuf(int, FILE *);
typedef long off_t;







typedef __longlong_t off64_t;
typedef __longlong_t fpos64_t;
extern unsigned char _sibuf[], _sobuf[];
extern unsigned char *_bufendtab[];
extern FILE *_lastbuf;
extern void setbuffer(FILE *, char *, size_t);
extern int setlinebuf(FILE *);





extern int snprintf(char *, size_t, const char *, ...);




extern int vsnprintf(char *, size_t, const char *, __gnuc_va_list);
extern FILE *fdopen(int, const char *);
extern char *ctermid(char *);
extern int fileno(FILE *);
extern FILE *popen(const char *, const char *);
extern char *cuserid(char *);
extern char *tempnam(const char *, const char *);
extern int getopt(int, char *const *, const char *);

extern int getsubopt(char **, char *const *, char **);

extern char *optarg;
extern int optind, opterr, optopt;
extern int getw(FILE *);
extern int putw(int, FILE *);
extern int pclose(FILE *);







extern int fseeko(FILE *, off_t, int);
extern off_t ftello(FILE *);
extern FILE *fopen64(const char *, const char *);
extern FILE *freopen64(const char *, const char *, FILE *);
extern FILE *tmpfile64(void);
extern int fgetpos64(FILE *, fpos64_t *);
extern int fsetpos64(FILE *, const fpos64_t *);
extern int fseeko64(FILE *, off64_t, int);
extern off64_t ftello64(FILE *);
#pragma ident "@(#)stdlib.h	1.47	99/11/03 SMI"

#pragma ident "@(#)stdlib_iso.h	1.2	99/12/21 SMI"







extern unsigned char __ctype[];
typedef struct {
        int quot;
        int rem;
} div_t;

typedef struct {
        long quot;
        long rem;
} ldiv_t;
typedef long wchar_t;






extern void abort(void);
extern int abs(int);
extern int atexit(void (*)(void));
extern double atof(const char *);
extern int atoi(const char *);
extern long int atol(const char *);
extern void *bsearch(const void *, const void *, size_t, size_t,
        int (*)(const void *, const void *));
extern void *calloc(size_t, size_t);
extern div_t div(int, int);
extern void exit(int);
extern void free(void *);
extern char *getenv(const char *);
extern long int labs(long);
extern ldiv_t ldiv(long, long);
extern void *malloc(size_t);
extern int mblen(const char *, size_t);
extern size_t mbstowcs(wchar_t *, const char *, size_t);
extern int mbtowc(wchar_t *, const char *, size_t);
extern void qsort(void *, size_t, size_t,
        int (*)(const void *, const void *));
extern int rand(void);
extern void *realloc(void *, size_t);
extern void srand(unsigned int);
extern double strtod(const char *, char **);
extern long int strtol(const char *, char **, int);
extern unsigned long int strtoul(const char *, char **, int);
extern int system(const char *);
extern int wctomb(char *, wchar_t);
extern size_t wcstombs(char *, const wchar_t *, size_t);
typedef struct {
        long long quot;
        long long rem;
} lldiv_t;







typedef long uid_t;
extern void _exithandle(void);




extern double drand48(void);
extern double erand48(unsigned short *);
extern long jrand48(unsigned short *);
extern void lcong48(unsigned short *);
extern long lrand48(void);
extern long mrand48(void);
extern long nrand48(unsigned short *);
extern unsigned short *seed48(unsigned short *);
extern void srand48(long);
extern int putenv(char *);
extern void setkey(const char *);
extern void swab(const char *, char *, ssize_t);





extern int mkstemp(char *);




extern int mkstemp64(char *);





extern long a64l(const char *);
extern char *ecvt(double, int, int *, int *);
extern char *fcvt(double, int, int *, int *);
extern char *gcvt(double, int, char *);
extern int getsubopt(char **, char *const *, char **);
extern int grantpt(int);
extern char *initstate(unsigned, char *, size_t);
extern char *l64a(long);
extern char *mktemp(char *);
extern char *ptsname(int);
extern long random(void);
extern char *realpath(const char *, char *);
extern char *setstate(const char *);
extern void srandom(unsigned);
extern int ttyslot(void);
extern int unlockpt(int);
extern void *valloc(size_t);




extern int dup2(int, int);
extern char *qecvt(long double, int, int *, int *);
extern char *qfcvt(long double, int, int *, int *);
extern char *qgcvt(long double, int, char *);
extern char *getcwd(char *, size_t);
extern const char *getexecname(void);
extern char *getlogin(void);
extern int getopt(int, char *const *, const char *);
extern char *optarg;
extern int optind, opterr, optopt;
extern char *getpass(const char *);
extern char *getpassphrase(const char *);
extern int getpw(uid_t, char *);
extern int isatty(int);
extern void *memalign(size_t, size_t);
extern char *ttyname(int);


extern long long atoll(const char *);
extern long long llabs(long long);
extern lldiv_t lldiv(long long, long long);
extern char *lltostr(long long, char *);
extern long long strtoll(const char *, char **, int);
extern unsigned long long strtoull(const char *, char **, int);
extern char *ulltostr(unsigned long long, char *);
#pragma ident "@(#)string.h	1.24	99/08/10 SMI"

#pragma ident "@(#)string_iso.h	1.2	99/11/09 SMI"


extern int memcmp(const void *, const void *, size_t);
extern void *memcpy(void *, const void *, size_t);
extern void *memmove(void *, const void *, size_t);
extern void *memset(void *, int, size_t);
extern char *strcat(char *, const char *);
extern int strcmp(const char *, const char *);
extern char *strcpy(char *, const char *);
extern int strcoll(const char *, const char *);
extern size_t strcspn(const char *, const char *);
extern char *strerror(int);
extern size_t strlen(const char *);
extern char *strncat(char *, const char *, size_t);
extern int strncmp(const char *, const char *, size_t);
extern char *strncpy(char *, const char *, size_t);
extern size_t strspn(const char *, const char *);
extern char *strtok(char *, const char *);
extern size_t strxfrm(char *, const char *, size_t);
extern void *memchr(const void *, int, size_t);
extern char *strchr(const char *, int);
extern char *strpbrk(const char *, const char *);
extern char *strrchr(const char *, int);
extern char *strstr(const char *, const char *);
extern void *memccpy(void *, const void *, int, size_t);




extern char *strsignal(int);
extern int ffs(int);
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, size_t);
extern size_t strlcpy(char *, const char *, size_t);
extern size_t strlcat(char *, const char *, size_t);





extern char *strdup(const char *);




#pragma ident "@(#)time.h	1.39	99/08/10 SMI"

#pragma ident "@(#)types.h	1.66	00/02/14 SMI"





#pragma ident "@(#)machtypes.h	1.8	99/05/04 SMI"




#pragma ident "@(#)machtypes.h	1.1	99/05/04 SMI"
typedef struct _label_t { long val[6]; } label_t;



typedef unsigned char lock_t;
#pragma ident "@(#)int_types.h	1.6	97/08/20 SMI"
typedef char int8_t;





typedef short int16_t;
typedef int int32_t;




typedef long long int64_t;



typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;




typedef unsigned long long uint64_t;
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
typedef int intptr_t;
typedef unsigned int uintptr_t;







typedef char int_least8_t;





typedef short int_least16_t;
typedef int int_least32_t;




typedef long long int_least64_t;



typedef unsigned char uint_least8_t;
typedef unsigned short uint_least16_t;
typedef unsigned int uint_least32_t;




typedef unsigned long long uint_least64_t;
typedef long long longlong_t;
typedef unsigned long long u_longlong_t;
typedef long t_scalar_t;
typedef unsigned long t_uscalar_t;





typedef unsigned char uchar_t;
typedef unsigned short ushort_t;
typedef unsigned int uint_t;
typedef unsigned long ulong_t;

typedef char *caddr_t;
typedef long daddr_t;
typedef short cnt_t;


typedef ulong_t paddr_t;
typedef int ptrdiff_t;
typedef ulong_t pfn_t;
typedef ulong_t pgcnt_t;
typedef long spgcnt_t;

typedef uchar_t use_t;
typedef short sysid_t;
typedef short index_t;
typedef void *timeout_id_t;
typedef void *bufcall_id_t;
typedef ulong_t ino_t;
typedef long blkcnt_t;
typedef ulong_t fsblkcnt_t;
typedef ulong_t fsfilcnt_t;
typedef u_longlong_t ino64_t;
typedef longlong_t blkcnt64_t;
typedef u_longlong_t fsblkcnt64_t;
typedef u_longlong_t fsfilcnt64_t;






typedef long blksize_t;





typedef enum { B_FALSE, B_TRUE } boolean_t;
typedef int64_t pad64_t;
typedef uint64_t upad64_t;
typedef longlong_t offset_t;
typedef u_longlong_t u_offset_t;
typedef u_longlong_t len_t;
typedef longlong_t diskaddr_t;







typedef union {
        offset_t _f;
        struct {
                int32_t _l;
                int32_t _u;
        } _p;
} lloff_t;
typedef union {
        diskaddr_t _f;
        struct {
                int32_t _l;
                int32_t _u;
        } _p;
} lldaddr_t;
typedef uint_t k_fltset_t;
typedef long id_t;






typedef uint_t useconds_t;



typedef long suseconds_t;
typedef ulong_t major_t;
typedef ulong_t minor_t;





typedef short pri_t;
typedef ushort_t o_mode_t;
typedef short o_dev_t;
typedef ushort_t o_uid_t;
typedef o_uid_t o_gid_t;
typedef short o_nlink_t;
typedef short o_pid_t;
typedef ushort_t o_ino_t;





typedef int key_t;



typedef ulong_t mode_t;
typedef uid_t gid_t;

typedef id_t taskid_t;
typedef id_t projid_t;






typedef unsigned int pthread_t;
typedef unsigned int pthread_key_t;

typedef struct _pthread_mutex {
        struct {
                uint16_t __pthread_mutex_flag1;
                uint8_t __pthread_mutex_flag2;
                uint8_t __pthread_mutex_ceiling;
                uint32_t __pthread_mutex_type;
        } __pthread_mutex_flags;
        union {
                struct {
                        uint8_t __pthread_mutex_pad[8];
                } __pthread_mutex_lock64;
                upad64_t __pthread_mutex_owner64;
        } __pthread_mutex_lock;
        upad64_t __pthread_mutex_data;
} pthread_mutex_t;

typedef struct _pthread_cond {
        struct {
                uint8_t __pthread_cond_flag[4];
                uint32_t __pthread_cond_type;
        } __pthread_cond_flags;
        upad64_t __pthread_cond_data;
} pthread_cond_t;




typedef struct _pthread_rwlock {
        int32_t __pthread_rwlock_readers;
        uint16_t __pthread_rwlock_type;
        uint16_t __pthread_rwlock_magic;
        upad64_t __pthread_rwlock_pad1[3];
        upad64_t __pthread_rwlock_pad2[2];
        upad64_t __pthread_rwlock_pad3[2];
} pthread_rwlock_t;




typedef struct _pthread_attr {
        void *__pthread_attrp;
} pthread_attr_t;





typedef struct _pthread_mutexattr {
        void *__pthread_mutexattrp;
} pthread_mutexattr_t;





typedef struct _pthread_condattr {
        void *__pthread_condattrp;
} pthread_condattr_t;




typedef struct _once {
        upad64_t __pthread_once_pad[4];
} pthread_once_t;





typedef struct _pthread_rwlockattr {
        void *__pthread_rwlockattrp;
} pthread_rwlockattr_t;

typedef ulong_t dev_t;





typedef ulong_t nlink_t;
typedef long pid_t;
typedef long time_t;




typedef long clock_t;




typedef int clockid_t;




typedef int timer_t;






typedef unsigned char unchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef struct _quad { int val[2]; } quad_t;
typedef quad_t quad;






#pragma ident "@(#)select.h	1.16	98/04/27 SMI"



#pragma ident "@(#)time.h	2.66	01/01/17 SMI"

struct timeval {
        time_t tv_sec;
        suseconds_t tv_usec;
};
struct timezone {
        int tz_minuteswest;
        int tz_dsttime;
};
struct itimerval {
        struct timeval it_interval;
        struct timeval it_value;
};
typedef longlong_t hrtime_t;
int adjtime(struct timeval *, struct timeval *);
int getitimer(int, struct itimerval *);
int utimes(const char *, const struct timeval *);



int setitimer(int, struct itimerval *, struct itimerval *);
int settimeofday(struct timeval *, void *);

hrtime_t gethrtime(void);
hrtime_t gethrvtime(void);
int gettimeofday(struct timeval *, void *);
typedef long fd_mask;

typedef long fds_mask;
typedef struct fd_set {



        long fds_bits[(((1024)+(((sizeof (fds_mask) * 8))-1))/((sizeof (fds_mask) * 8)))];
} fd_set;
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
#pragma ident "@(#)time_iso.h	1.1	99/08/09 SMI"

struct tm {
        int tm_sec;
        int tm_min;
        int tm_hour;
        int tm_mday;
        int tm_mon;
        int tm_year;
        int tm_wday;
        int tm_yday;
        int tm_isdst;
};




extern char *asctime(const struct tm *);
extern clock_t clock(void);
extern char *ctime(const time_t *);
extern double difftime(time_t, time_t);
extern struct tm *gmtime(const time_t *);
extern struct tm *localtime(const time_t *);
extern time_t mktime(struct tm *);
extern time_t time(time_t *);
extern size_t strftime(char *, size_t, const char *, const struct tm *);
extern char *strptime(const char *, const char *, struct tm *);
#pragma ident "@(#)time_impl.h	1.5	99/10/05 SMI"

typedef struct timespec {
        time_t tv_sec;
        long tv_nsec;
} timespec_t;
typedef struct timespec timestruc_t;
typedef struct itimerspec {
        struct timespec it_interval;
        struct timespec it_value;
} itimerspec_t;
union sigval {
        int sival_int;
        void *sival_ptr;
};




struct sigevent {
        int sigev_notify;
        int sigev_signo;
        union sigval sigev_value;
        void (*sigev_notify_function)(union sigval);
        pthread_attr_t *sigev_notify_attributes;
        int __sigev_pad2;
};


extern int clock_getres(clockid_t, struct timespec *);
extern int clock_gettime(clockid_t, struct timespec *);
extern int clock_settime(clockid_t, const struct timespec *);
extern int timer_create(clockid_t, struct sigevent *, timer_t *);
extern int timer_delete(timer_t);
extern int timer_getoverrun(timer_t);
extern int timer_gettime(timer_t, struct itimerspec *);
extern int timer_settime(timer_t, int, const struct itimerspec *,
                struct itimerspec *);
extern int nanosleep(const struct timespec *, struct timespec *);




extern void tzset(void);

extern char *tzname[2];


extern long _sysconf(int);






extern long timezone;
extern int daylight;





extern int cftime(char *, char *, const time_t *);
extern int ascftime(char *, const char *, const struct tm *);
extern long altzone;




extern struct tm *getdate(const char *);






extern int getdate_err;

typedef void VOID;
typedef int INT;
typedef unsigned int UINT;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned long ULONG;
typedef unsigned char BYTE;
typedef long LONG;
typedef short SHORT;
typedef unsigned short USHORT;
typedef char CHAR;
typedef unsigned char UCHAR;

typedef LONG SCODE;


typedef unsigned short WCHAR;
typedef int WIN_BOOL;
typedef double DATE;
typedef double DOUBLE;
typedef long long LONGLONG;
typedef unsigned long long ULONGLONG;
typedef UINT HANDLE;



typedef HANDLE *LPHANDLE;


typedef UINT WPARAM;
typedef LONG LPARAM;
typedef LONG HRESULT;
typedef LONG LRESULT;
typedef WORD ATOM;
typedef WORD CATCHBUF[9];
typedef WORD *LPCATCHBUF;
typedef HANDLE HHOOK;
typedef HANDLE HMONITOR;
typedef DWORD LCID;
typedef WORD LANGID;
typedef DWORD LCTYPE;
typedef float FLOAT;



typedef VOID *PVOID;
typedef const void *PCVOID;
typedef CHAR *PCHAR;
typedef UCHAR *PUCHAR;
typedef BYTE *PBYTE;
typedef WORD *PWORD;
typedef USHORT *PUSHORT;
typedef SHORT *PSHORT;
typedef ULONG *PULONG;
typedef LONG *PLONG;
typedef DWORD *PDWORD;

typedef CHAR *LPSTR;
typedef CHAR *PSTR;
typedef const CHAR *LPCSTR;
typedef const CHAR *PCSTR;
typedef WCHAR *LPWSTR;
typedef WCHAR *PWSTR;
typedef const WCHAR *LPCWSTR;
typedef const WCHAR *PCWSTR;
typedef BYTE *LPBYTE;
typedef WORD *LPWORD;
typedef DWORD *LPDWORD;
typedef LONG *LPLONG;
typedef VOID *LPVOID;
typedef const VOID *LPCVOID;
typedef INT *PINT;
typedef INT *LPINT;
typedef UINT *PUINT;
typedef UINT *LPUINT;
typedef FLOAT *PFLOAT;
typedef FLOAT *LPFLOAT;
typedef WIN_BOOL *PWIN_BOOL;
typedef WIN_BOOL *LPWIN_BOOL;






typedef void* SEGPTR;
typedef HANDLE HACMDRIVERID; typedef HACMDRIVERID *PHACMDRIVERID; typedef HACMDRIVERID *LPHACMDRIVERID;
typedef HANDLE HACMDRIVER; typedef HACMDRIVER *PHACMDRIVER; typedef HACMDRIVER *LPHACMDRIVER;
typedef HANDLE HACMOBJ; typedef HACMOBJ *PHACMOBJ; typedef HACMOBJ *LPHACMOBJ;
typedef HANDLE HACMSTREAM; typedef HACMSTREAM *PHACMSTREAM; typedef HACMSTREAM *LPHACMSTREAM;
typedef HANDLE HMETAFILEPICT; typedef HMETAFILEPICT *PHMETAFILEPICT; typedef HMETAFILEPICT *LPHMETAFILEPICT;

typedef HANDLE HACCEL; typedef HACCEL *PHACCEL; typedef HACCEL *LPHACCEL;
typedef HANDLE HBITMAP; typedef HBITMAP *PHBITMAP; typedef HBITMAP *LPHBITMAP;
typedef HANDLE HBRUSH; typedef HBRUSH *PHBRUSH; typedef HBRUSH *LPHBRUSH;
typedef HANDLE HCOLORSPACE; typedef HCOLORSPACE *PHCOLORSPACE; typedef HCOLORSPACE *LPHCOLORSPACE;
typedef HANDLE HCURSOR; typedef HCURSOR *PHCURSOR; typedef HCURSOR *LPHCURSOR;
typedef HANDLE HDC; typedef HDC *PHDC; typedef HDC *LPHDC;
typedef HANDLE HDROP; typedef HDROP *PHDROP; typedef HDROP *LPHDROP;
typedef HANDLE HDRVR; typedef HDRVR *PHDRVR; typedef HDRVR *LPHDRVR;
typedef HANDLE HDWP; typedef HDWP *PHDWP; typedef HDWP *LPHDWP;
typedef HANDLE HENHMETAFILE; typedef HENHMETAFILE *PHENHMETAFILE; typedef HENHMETAFILE *LPHENHMETAFILE;
typedef HANDLE HFILE; typedef HFILE *PHFILE; typedef HFILE *LPHFILE;
typedef HANDLE HFONT; typedef HFONT *PHFONT; typedef HFONT *LPHFONT;
typedef HANDLE HICON; typedef HICON *PHICON; typedef HICON *LPHICON;
typedef HANDLE HINSTANCE; typedef HINSTANCE *PHINSTANCE; typedef HINSTANCE *LPHINSTANCE;
typedef HANDLE HKEY; typedef HKEY *PHKEY; typedef HKEY *LPHKEY;
typedef HANDLE HMENU; typedef HMENU *PHMENU; typedef HMENU *LPHMENU;
typedef HANDLE HMETAFILE; typedef HMETAFILE *PHMETAFILE; typedef HMETAFILE *LPHMETAFILE;
typedef HANDLE HMIDI; typedef HMIDI *PHMIDI; typedef HMIDI *LPHMIDI;
typedef HANDLE HMIDIIN; typedef HMIDIIN *PHMIDIIN; typedef HMIDIIN *LPHMIDIIN;
typedef HANDLE HMIDIOUT; typedef HMIDIOUT *PHMIDIOUT; typedef HMIDIOUT *LPHMIDIOUT;
typedef HANDLE HMIDISTRM; typedef HMIDISTRM *PHMIDISTRM; typedef HMIDISTRM *LPHMIDISTRM;
typedef HANDLE HMIXER; typedef HMIXER *PHMIXER; typedef HMIXER *LPHMIXER;
typedef HANDLE HMIXEROBJ; typedef HMIXEROBJ *PHMIXEROBJ; typedef HMIXEROBJ *LPHMIXEROBJ;
typedef HANDLE HMMIO; typedef HMMIO *PHMMIO; typedef HMMIO *LPHMMIO;
typedef HANDLE HPALETTE; typedef HPALETTE *PHPALETTE; typedef HPALETTE *LPHPALETTE;
typedef HANDLE HPEN; typedef HPEN *PHPEN; typedef HPEN *LPHPEN;
typedef HANDLE HQUEUE; typedef HQUEUE *PHQUEUE; typedef HQUEUE *LPHQUEUE;
typedef HANDLE HRGN; typedef HRGN *PHRGN; typedef HRGN *LPHRGN;
typedef HANDLE HRSRC; typedef HRSRC *PHRSRC; typedef HRSRC *LPHRSRC;
typedef HANDLE HTASK; typedef HTASK *PHTASK; typedef HTASK *LPHTASK;
typedef HANDLE HWAVE; typedef HWAVE *PHWAVE; typedef HWAVE *LPHWAVE;
typedef HANDLE HWAVEIN; typedef HWAVEIN *PHWAVEIN; typedef HWAVEIN *LPHWAVEIN;
typedef HANDLE HWAVEOUT; typedef HWAVEOUT *PHWAVEOUT; typedef HWAVEOUT *LPHWAVEOUT;
typedef HANDLE HWINSTA; typedef HWINSTA *PHWINSTA; typedef HWINSTA *LPHWINSTA;
typedef HANDLE HDESK; typedef HDESK *PHDESK; typedef HDESK *LPHDESK;
typedef HANDLE HWND; typedef HWND *PHWND; typedef HWND *LPHWND;
typedef HANDLE HKL; typedef HKL *PHKL; typedef HKL *LPHKL;
typedef HANDLE HIC; typedef HIC *PHIC; typedef HIC *LPHIC;
typedef HANDLE HRASCONN; typedef HRASCONN *PHRASCONN; typedef HRASCONN *LPHRASCONN;



typedef HINSTANCE HMODULE;
typedef HANDLE HGDIOBJ;
typedef HANDLE HGLOBAL;
typedef HANDLE HLOCAL;
typedef HANDLE GLOBALHANDLE;
typedef HANDLE LOCALHANDLE;




typedef WIN_BOOL __attribute__((__stdcall__)) (* DATEFMT_ENUMPROCA)(LPSTR);
typedef WIN_BOOL __attribute__((__stdcall__)) (* DATEFMT_ENUMPROCW)(LPWSTR);
typedef DATEFMT_ENUMPROCA DATEFMT_ENUMPROC;
typedef WIN_BOOL __attribute__((__stdcall__)) (*DLGPROC)(HWND,UINT,WPARAM,LPARAM);
typedef LRESULT __attribute__((__stdcall__)) (*DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
typedef INT __attribute__((__stdcall__)) (*EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
typedef INT __attribute__((__stdcall__)) (*EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
typedef EDITWORDBREAKPROCA EDITWORDBREAKPROC;
typedef LRESULT __attribute__((__stdcall__)) (*FARPROC)();
typedef INT __attribute__((__stdcall__)) (*PROC)();
typedef WIN_BOOL __attribute__((__stdcall__)) (*GRAYSTRINGPROC)(HDC,LPARAM,INT);
typedef LRESULT __attribute__((__stdcall__)) (*HOOKPROC)(INT,WPARAM,LPARAM);
typedef WIN_BOOL __attribute__((__stdcall__)) (*PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
typedef WIN_BOOL __attribute__((__stdcall__)) (*PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
typedef PROPENUMPROCA PROPENUMPROC;
typedef WIN_BOOL __attribute__((__stdcall__)) (*PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM);
typedef WIN_BOOL __attribute__((__stdcall__)) (*PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM);
typedef PROPENUMPROCEXA PROPENUMPROCEX;
typedef WIN_BOOL __attribute__((__stdcall__)) (* TIMEFMT_ENUMPROCA)(LPSTR);
typedef WIN_BOOL __attribute__((__stdcall__)) (* TIMEFMT_ENUMPROCW)(LPWSTR);
typedef TIMEFMT_ENUMPROCA TIMEFMT_ENUMPROC;
typedef VOID __attribute__((__stdcall__)) (*TIMERPROC)(HWND,UINT,UINT,DWORD);
typedef WIN_BOOL __attribute__((__stdcall__)) (*WNDENUMPROC)(HWND,LPARAM);
typedef LRESULT __attribute__((__stdcall__)) (*WNDPROC)(HWND,UINT,WPARAM,LPARAM);



typedef short INT16;
typedef unsigned short UINT16;
typedef unsigned short WIN_BOOL16;

typedef UINT16 HANDLE16;
typedef HANDLE16 *LPHANDLE16;

typedef UINT16 WPARAM16;
typedef INT16 *LPINT16;
typedef UINT16 *LPUINT16;







typedef HANDLE16 HACMDRIVERID16; typedef HACMDRIVERID16 *PHACMDRIVERID16; typedef HACMDRIVERID16 *NPHACMDRIVERID16; typedef HACMDRIVERID16 *LPHACMDRIVERID16;
typedef HANDLE16 HACMDRIVER16; typedef HACMDRIVER16 *PHACMDRIVER16; typedef HACMDRIVER16 *NPHACMDRIVER16; typedef HACMDRIVER16 *LPHACMDRIVER16;
typedef HANDLE16 HACMOBJ16; typedef HACMOBJ16 *PHACMOBJ16; typedef HACMOBJ16 *NPHACMOBJ16; typedef HACMOBJ16 *LPHACMOBJ16;
typedef HANDLE16 HACMSTREAM16; typedef HACMSTREAM16 *PHACMSTREAM16; typedef HACMSTREAM16 *NPHACMSTREAM16; typedef HACMSTREAM16 *LPHACMSTREAM16;
typedef HANDLE16 HMETAFILEPICT16; typedef HMETAFILEPICT16 *PHMETAFILEPICT16; typedef HMETAFILEPICT16 *NPHMETAFILEPICT16; typedef HMETAFILEPICT16 *LPHMETAFILEPICT16;

typedef HANDLE16 HACCEL16; typedef HACCEL16 *PHACCEL16; typedef HACCEL16 *NPHACCEL16; typedef HACCEL16 *LPHACCEL16;
typedef HANDLE16 HBITMAP16; typedef HBITMAP16 *PHBITMAP16; typedef HBITMAP16 *NPHBITMAP16; typedef HBITMAP16 *LPHBITMAP16;
typedef HANDLE16 HBRUSH16; typedef HBRUSH16 *PHBRUSH16; typedef HBRUSH16 *NPHBRUSH16; typedef HBRUSH16 *LPHBRUSH16;
typedef HANDLE16 HCOLORSPACE16; typedef HCOLORSPACE16 *PHCOLORSPACE16; typedef HCOLORSPACE16 *NPHCOLORSPACE16; typedef HCOLORSPACE16 *LPHCOLORSPACE16;
typedef HANDLE16 HCURSOR16; typedef HCURSOR16 *PHCURSOR16; typedef HCURSOR16 *NPHCURSOR16; typedef HCURSOR16 *LPHCURSOR16;
typedef HANDLE16 HDC16; typedef HDC16 *PHDC16; typedef HDC16 *NPHDC16; typedef HDC16 *LPHDC16;
typedef HANDLE16 HDROP16; typedef HDROP16 *PHDROP16; typedef HDROP16 *NPHDROP16; typedef HDROP16 *LPHDROP16;
typedef HANDLE16 HDRVR16; typedef HDRVR16 *PHDRVR16; typedef HDRVR16 *NPHDRVR16; typedef HDRVR16 *LPHDRVR16;
typedef HANDLE16 HDWP16; typedef HDWP16 *PHDWP16; typedef HDWP16 *NPHDWP16; typedef HDWP16 *LPHDWP16;
typedef HANDLE16 HENHMETAFILE16; typedef HENHMETAFILE16 *PHENHMETAFILE16; typedef HENHMETAFILE16 *NPHENHMETAFILE16; typedef HENHMETAFILE16 *LPHENHMETAFILE16;
typedef HANDLE16 HFILE16; typedef HFILE16 *PHFILE16; typedef HFILE16 *NPHFILE16; typedef HFILE16 *LPHFILE16;
typedef HANDLE16 HFONT16; typedef HFONT16 *PHFONT16; typedef HFONT16 *NPHFONT16; typedef HFONT16 *LPHFONT16;
typedef HANDLE16 HICON16; typedef HICON16 *PHICON16; typedef HICON16 *NPHICON16; typedef HICON16 *LPHICON16;
typedef HANDLE16 HINSTANCE16; typedef HINSTANCE16 *PHINSTANCE16; typedef HINSTANCE16 *NPHINSTANCE16; typedef HINSTANCE16 *LPHINSTANCE16;
typedef HANDLE16 HKEY16; typedef HKEY16 *PHKEY16; typedef HKEY16 *NPHKEY16; typedef HKEY16 *LPHKEY16;
typedef HANDLE16 HMENU16; typedef HMENU16 *PHMENU16; typedef HMENU16 *NPHMENU16; typedef HMENU16 *LPHMENU16;
typedef HANDLE16 HMETAFILE16; typedef HMETAFILE16 *PHMETAFILE16; typedef HMETAFILE16 *NPHMETAFILE16; typedef HMETAFILE16 *LPHMETAFILE16;
typedef HANDLE16 HMIDI16; typedef HMIDI16 *PHMIDI16; typedef HMIDI16 *NPHMIDI16; typedef HMIDI16 *LPHMIDI16;
typedef HANDLE16 HMIDIIN16; typedef HMIDIIN16 *PHMIDIIN16; typedef HMIDIIN16 *NPHMIDIIN16; typedef HMIDIIN16 *LPHMIDIIN16;
typedef HANDLE16 HMIDIOUT16; typedef HMIDIOUT16 *PHMIDIOUT16; typedef HMIDIOUT16 *NPHMIDIOUT16; typedef HMIDIOUT16 *LPHMIDIOUT16;
typedef HANDLE16 HMIDISTRM16; typedef HMIDISTRM16 *PHMIDISTRM16; typedef HMIDISTRM16 *NPHMIDISTRM16; typedef HMIDISTRM16 *LPHMIDISTRM16;
typedef HANDLE16 HMIXER16; typedef HMIXER16 *PHMIXER16; typedef HMIXER16 *NPHMIXER16; typedef HMIXER16 *LPHMIXER16;
typedef HANDLE16 HMIXEROBJ16; typedef HMIXEROBJ16 *PHMIXEROBJ16; typedef HMIXEROBJ16 *NPHMIXEROBJ16; typedef HMIXEROBJ16 *LPHMIXEROBJ16;
typedef HANDLE16 HMMIO16; typedef HMMIO16 *PHMMIO16; typedef HMMIO16 *NPHMMIO16; typedef HMMIO16 *LPHMMIO16;
typedef HANDLE16 HPALETTE16; typedef HPALETTE16 *PHPALETTE16; typedef HPALETTE16 *NPHPALETTE16; typedef HPALETTE16 *LPHPALETTE16;
typedef HANDLE16 HPEN16; typedef HPEN16 *PHPEN16; typedef HPEN16 *NPHPEN16; typedef HPEN16 *LPHPEN16;
typedef HANDLE16 HQUEUE16; typedef HQUEUE16 *PHQUEUE16; typedef HQUEUE16 *NPHQUEUE16; typedef HQUEUE16 *LPHQUEUE16;
typedef HANDLE16 HRGN16; typedef HRGN16 *PHRGN16; typedef HRGN16 *NPHRGN16; typedef HRGN16 *LPHRGN16;
typedef HANDLE16 HRSRC16; typedef HRSRC16 *PHRSRC16; typedef HRSRC16 *NPHRSRC16; typedef HRSRC16 *LPHRSRC16;
typedef HANDLE16 HTASK16; typedef HTASK16 *PHTASK16; typedef HTASK16 *NPHTASK16; typedef HTASK16 *LPHTASK16;
typedef HANDLE16 HWAVE16; typedef HWAVE16 *PHWAVE16; typedef HWAVE16 *NPHWAVE16; typedef HWAVE16 *LPHWAVE16;
typedef HANDLE16 HWAVEIN16; typedef HWAVEIN16 *PHWAVEIN16; typedef HWAVEIN16 *NPHWAVEIN16; typedef HWAVEIN16 *LPHWAVEIN16;
typedef HANDLE16 HWAVEOUT16; typedef HWAVEOUT16 *PHWAVEOUT16; typedef HWAVEOUT16 *NPHWAVEOUT16; typedef HWAVEOUT16 *LPHWAVEOUT16;
typedef HANDLE16 HWINSTA16; typedef HWINSTA16 *PHWINSTA16; typedef HWINSTA16 *NPHWINSTA16; typedef HWINSTA16 *LPHWINSTA16;
typedef HANDLE16 HDESK16; typedef HDESK16 *PHDESK16; typedef HDESK16 *NPHDESK16; typedef HDESK16 *LPHDESK16;
typedef HANDLE16 HWND16; typedef HWND16 *PHWND16; typedef HWND16 *NPHWND16; typedef HWND16 *LPHWND16;
typedef HANDLE16 HKL16; typedef HKL16 *PHKL16; typedef HKL16 *NPHKL16; typedef HKL16 *LPHKL16;
typedef HANDLE16 HIC16; typedef HIC16 *PHIC16; typedef HIC16 *NPHIC16; typedef HIC16 *LPHIC16;
typedef HANDLE16 HRASCONN16; typedef HRASCONN16 *PHRASCONN16; typedef HRASCONN16 *NPHRASCONN16; typedef HRASCONN16 *LPHRASCONN16;


typedef HINSTANCE16 HMODULE16;
typedef HANDLE16 HGDIOBJ16;
typedef HANDLE16 HGLOBAL16;
typedef HANDLE16 HLOCAL16;


typedef struct
{
    INT16 cx;
    INT16 cy;
} SIZE16, *PSIZE16, *LPSIZE16;



typedef struct
{
    INT16 x;
    INT16 y;
} POINT16, *PPOINT16, *LPPOINT16;



typedef struct
{
    INT16 left;
    INT16 top;
    INT16 right;
    INT16 bottom;
} RECT16, *LPRECT16;



typedef LRESULT __attribute__((__stdcall__)) (*DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
typedef WIN_BOOL16 __attribute__((__stdcall__)) (*DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
typedef INT16 __attribute__((__stdcall__)) (*EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
typedef LRESULT __attribute__((__stdcall__)) (*FARPROC16)();
typedef INT16 __attribute__((__stdcall__)) (*PROC16)();
typedef WIN_BOOL16 __attribute__((__stdcall__)) (*GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
typedef LRESULT __attribute__((__stdcall__)) (*HOOKPROC16)(INT16,WPARAM16,LPARAM);
typedef WIN_BOOL16 __attribute__((__stdcall__)) (*PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
typedef VOID __attribute__((__stdcall__)) (*TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
typedef LRESULT __attribute__((__stdcall__)) (*WNDENUMPROC16)(HWND16,LPARAM);
typedef LRESULT __attribute__((__stdcall__)) (*WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
typedef struct tagSIZE
{
    INT cx;
    INT cy;
} SIZE, *PSIZE, *LPSIZE;


typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;







typedef struct tagPOINT
{
    LONG x;
    LONG y;
} POINT, *PPOINT, *LPPOINT;

typedef struct _POINTL
{
    LONG x;
    LONG y;
} POINTL;
typedef struct tagPOINTS
{
        SHORT x;
        SHORT y;
} POINTS, *PPOINTS, *LPPOINTS;






typedef struct tagRECT
{
    short left;
    short top;
    short right;
    short bottom;
} RECT, *PRECT, *LPRECT;
typedef const RECT *LPCRECT;


typedef struct tagRECTL
{
    LONG left;
    LONG top;
    LONG right;
    LONG bottom;
} RECTL, *PRECTL, *LPRECTL;

typedef const RECTL *LPCRECTL;



typedef char __int8;
typedef unsigned char __uint8;

typedef short __int16;
typedef unsigned short __uint16;

typedef int __int32;
typedef unsigned int __uint32;

typedef long long __int64;
typedef unsigned long long __uint64;
typedef void *__ptr32;
typedef __uint64 __ptr64;





typedef __int32 LONG32;


typedef LONG32 *PLONG32;




typedef __uint32 ULONG32;
typedef __uint32 DWORD32;
typedef __uint32 UINT32;

typedef ULONG32 *PULONG32;
typedef DWORD32 *PDWORD32;
typedef UINT32 *PUINT32;



typedef __int64 LONG64;
typedef __int64 INT64;

typedef LONG64 *PLONG64;
typedef INT64 *PINT64;



typedef __uint64 ULONG64;
typedef __uint64 DWORD64;
typedef __uint64 UINT64;

typedef ULONG64 *PULONG64;
typedef DWORD64 *PDWORD64;
typedef UINT64 *PUINT64;
typedef __int32 INT_PTR, *PINT_PTR;
typedef __uint32 UINT_PTR, *PUINT_PTR;





typedef __int16 HALF_PTR, *PHALF_PTR;
typedef __uint16 UHALF_PTR, *PUHALF_PTR;





typedef __int32 LONG_PTR, *PLONG_PTR;
typedef __uint32 ULONG_PTR, *PULONG_PTR;
typedef __uint32 DWORD_PTR, *PDWORD_PTR;



typedef INT_PTR SSIZE_T, *PSSIZE_T;
typedef UINT_PTR SIZE_T, *PSIZE_T;




typedef char TCHAR, *PTCHAR;
typedef LPSTR PTSTR, LPTSTR;
typedef LPCSTR PCTSTR, LPCTSTR;





typedef BYTE BOOLEAN;
typedef BOOLEAN *PBOOLEAN;

typedef struct _LIST_ENTRY {
  struct _LIST_ENTRY *Flink;
  struct _LIST_ENTRY *Blink;
} LIST_ENTRY, *PLIST_ENTRY;

typedef struct _SINGLE_LIST_ENTRY {
  struct _SINGLE_LIST_ENTRY *Next;
} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY;
typedef struct _FLOATING_SAVE_AREA
{
    DWORD ControlWord;
    DWORD StatusWord;
    DWORD TagWord;
    DWORD ErrorOffset;
    DWORD ErrorSelector;
    DWORD DataOffset;
    DWORD DataSelector;
    BYTE RegisterArea[80];
    DWORD Cr0NpxState;
} FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA;

typedef struct _CONTEXT86
{
    DWORD ContextFlags;


    DWORD Dr0;
    DWORD Dr1;
    DWORD Dr2;
    DWORD Dr3;
    DWORD Dr6;
    DWORD Dr7;


    FLOATING_SAVE_AREA FloatSave;


    DWORD SegGs;
    DWORD SegFs;
    DWORD SegEs;
    DWORD SegDs;


    DWORD Edi;
    DWORD Esi;
    DWORD Ebx;
    DWORD Edx;
    DWORD Ecx;
    DWORD Eax;


    DWORD Ebp;
    DWORD Eip;
    DWORD SegCs;
    DWORD EFlags;
    DWORD Esp;
    DWORD SegSs;
} CONTEXT86;
typedef CONTEXT86 CONTEXT;
typedef CONTEXT *PCONTEXT;
typedef HANDLE *PHANDLE;
typedef struct __EXCEPTION_RECORD
{
    DWORD ExceptionCode;
    DWORD ExceptionFlags;
    struct __EXCEPTION_RECORD *ExceptionRecord;

    LPVOID ExceptionAddress;
    DWORD NumberParameters;
    DWORD ExceptionInformation[15];
} EXCEPTION_RECORD, *PEXCEPTION_RECORD;






typedef struct _EXCEPTION_POINTERS
{
  PEXCEPTION_RECORD ExceptionRecord;
  PCONTEXT ContextRecord;
} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
struct __EXCEPTION_FRAME;

typedef DWORD (*PEXCEPTION_HANDLER)(PEXCEPTION_RECORD,struct __EXCEPTION_FRAME*,
                                    PCONTEXT,struct __EXCEPTION_FRAME **);

typedef struct __EXCEPTION_FRAME
{
  struct __EXCEPTION_FRAME *Prev;
  PEXCEPTION_HANDLER Handler;
} EXCEPTION_FRAME, *PEXCEPTION_FRAME;





#pragma pack()





typedef LONG __attribute__((__stdcall__)) (*PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo);
typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;

DWORD __attribute__((__stdcall__)) UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers );
LPTOP_LEVEL_EXCEPTION_FILTER
__attribute__((__stdcall__)) SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter );
typedef struct _NT_TIB
{
        struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
        PVOID StackBase;
        PVOID StackLimit;
        PVOID SubSystemTib;
        union {
          PVOID FiberData;
          DWORD Version;
        } u;
        PVOID ArbitraryUserPointer;
        struct _NT_TIB *Self;
} NT_TIB, *PNT_TIB;

struct _TEB;
typedef struct _IMAGE_DOS_HEADER {
    WORD e_magic;
    WORD e_cblp;
    WORD e_cp;
    WORD e_crlc;
    WORD e_cparhdr;
    WORD e_minalloc;
    WORD e_maxalloc;
    WORD e_ss;
    WORD e_sp;
    WORD e_csum;
    WORD e_ip;
    WORD e_cs;
    WORD e_lfarlc;
    WORD e_ovno;
    WORD e_res[4];
    WORD e_oemid;
    WORD e_oeminfo;
    WORD e_res2[10];
    DWORD e_lfanew;
} IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
typedef struct
{
    WORD ne_magic;
    BYTE ne_ver;
    BYTE ne_rev;
    WORD ne_enttab;
    WORD ne_cbenttab;
    LONG ne_crc;
    WORD ne_flags;
    WORD ne_autodata;
    WORD ne_heap;
    WORD ne_stack;
    DWORD ne_csip;
    DWORD ne_sssp;
    WORD ne_cseg;
    WORD ne_cmod;
    WORD ne_cbnrestab;
    WORD ne_segtab;
    WORD ne_rsrctab;
    WORD ne_restab;
    WORD ne_modtab;
    WORD ne_imptab;
    DWORD ne_nrestab;
    WORD ne_cmovent;
    WORD ne_align;
    WORD ne_cres;
    BYTE ne_exetyp;
    BYTE ne_flagsothers;
    WORD fastload_offset;
    WORD fastload_length;
    WORD ne_swaparea;
    WORD ne_expver;
} IMAGE_OS2_HEADER,*PIMAGE_OS2_HEADER;

typedef struct _IMAGE_VXD_HEADER {
  WORD e32_magic;
  BYTE e32_border;
  BYTE e32_worder;
  DWORD e32_level;
  WORD e32_cpu;
  WORD e32_os;
  DWORD e32_ver;
  DWORD e32_mflags;
  DWORD e32_mpages;
  DWORD e32_startobj;
  DWORD e32_eip;
  DWORD e32_stackobj;
  DWORD e32_esp;
  DWORD e32_pagesize;
  DWORD e32_lastpagesize;
  DWORD e32_fixupsize;
  DWORD e32_fixupsum;
  DWORD e32_ldrsize;
  DWORD e32_ldrsum;
  DWORD e32_objtab;
  DWORD e32_objcnt;
  DWORD e32_objmap;
  DWORD e32_itermap;
  DWORD e32_rsrctab;
  DWORD e32_rsrccnt;
  DWORD e32_restab;
  DWORD e32_enttab;
  DWORD e32_dirtab;
  DWORD e32_dircnt;
  DWORD e32_fpagetab;
  DWORD e32_frectab;
  DWORD e32_impmod;
  DWORD e32_impmodcnt;
  DWORD e32_impproc;
  DWORD e32_pagesum;
  DWORD e32_datapage;
  DWORD e32_preload;
  DWORD e32_nrestab;
  DWORD e32_cbnrestab;
  DWORD e32_nressum;
  DWORD e32_autodata;
  DWORD e32_debuginfo;
  DWORD e32_debuglen;
  DWORD e32_instpreload;
  DWORD e32_instdemand;
  DWORD e32_heapsize;
  BYTE e32_res3[12];
  DWORD e32_winresoff;
  DWORD e32_winreslen;
  WORD e32_devid;
  WORD e32_ddkver;
} IMAGE_VXD_HEADER, *PIMAGE_VXD_HEADER;
typedef struct _IMAGE_FILE_HEADER {
  WORD Machine;
  WORD NumberOfSections;
  DWORD TimeDateStamp;
  DWORD PointerToSymbolTable;
  DWORD NumberOfSymbols;
  WORD SizeOfOptionalHeader;
  WORD Characteristics;
} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;

typedef struct _IMAGE_DATA_DIRECTORY {
  DWORD VirtualAddress;
  DWORD Size;
} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;



typedef struct _IMAGE_OPTIONAL_HEADER {



  WORD Magic;
  BYTE MajorLinkerVersion;
  BYTE MinorLinkerVersion;
  DWORD SizeOfCode;
  DWORD SizeOfInitializedData;
  DWORD SizeOfUninitializedData;
  DWORD AddressOfEntryPoint;
  DWORD BaseOfCode;
  DWORD BaseOfData;



  DWORD ImageBase;
  DWORD SectionAlignment;
  DWORD FileAlignment;
  WORD MajorOperatingSystemVersion;
  WORD MinorOperatingSystemVersion;
  WORD MajorImageVersion;
  WORD MinorImageVersion;
  WORD MajorSubsystemVersion;
  WORD MinorSubsystemVersion;
  DWORD Win32VersionValue;
  DWORD SizeOfImage;
  DWORD SizeOfHeaders;
  DWORD CheckSum;
  WORD Subsystem;
  WORD DllCharacteristics;
  DWORD SizeOfStackReserve;
  DWORD SizeOfStackCommit;
  DWORD SizeOfHeapReserve;
  DWORD SizeOfHeapCommit;
  DWORD LoaderFlags;
  DWORD NumberOfRvaAndSizes;
  IMAGE_DATA_DIRECTORY DataDirectory[16];
} IMAGE_OPTIONAL_HEADER, *PIMAGE_OPTIONAL_HEADER;

typedef struct _IMAGE_NT_HEADERS {
  DWORD Signature;
  IMAGE_FILE_HEADER FileHeader;
  IMAGE_OPTIONAL_HEADER OptionalHeader;
} IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS;



typedef struct _IMAGE_SECTION_HEADER {
  BYTE Name[8];
  union {
    DWORD PhysicalAddress;
    DWORD VirtualSize;
  } Misc;
  DWORD VirtualAddress;
  DWORD SizeOfRawData;
  DWORD PointerToRawData;
  DWORD PointerToRelocations;
  DWORD PointerToLinenumbers;
  WORD NumberOfRelocations;
  WORD NumberOfLinenumbers;
  DWORD Characteristics;
} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;

typedef struct _IMAGE_SYMBOL {
    union {
        BYTE ShortName[8];
        struct {
            DWORD Short;
            DWORD Long;
        } Name;
        DWORD LongName[2];
    } N;
    DWORD Value;
    SHORT SectionNumber;
    WORD Type;
    BYTE StorageClass;
    BYTE NumberOfAuxSymbols;
} IMAGE_SYMBOL;
typedef IMAGE_SYMBOL *PIMAGE_SYMBOL;



typedef struct _IMAGE_LINENUMBER {
    union {
        DWORD SymbolTableIndex;
        DWORD VirtualAddress;
    } Type;
    WORD Linenumber;
} IMAGE_LINENUMBER;
typedef IMAGE_LINENUMBER *PIMAGE_LINENUMBER;



typedef union _IMAGE_AUX_SYMBOL {
    struct {
        DWORD TagIndex;
        union {
            struct {
                WORD Linenumber;
                WORD Size;
            } LnSz;
           DWORD TotalSize;
        } Misc;
        union {
            struct {
                DWORD PointerToLinenumber;
                DWORD PointerToNextFunction;
            } Function;
            struct {
                WORD Dimension[4];
            } Array;
        } FcnAry;
        WORD TvIndex;
    } Sym;
    struct {
        BYTE Name[18];
    } File;
    struct {
        DWORD Length;
        WORD NumberOfRelocations;
        WORD NumberOfLinenumbers;
        DWORD CheckSum;
        SHORT Number;
        BYTE Selection;
    } Section;
} IMAGE_AUX_SYMBOL;
typedef IMAGE_AUX_SYMBOL *PIMAGE_AUX_SYMBOL;







#pragma pack()
typedef struct _IMAGE_EXPORT_DIRECTORY {
        DWORD Characteristics;
        DWORD TimeDateStamp;
        WORD MajorVersion;
        WORD MinorVersion;
        DWORD Name;
        DWORD Base;
        DWORD NumberOfFunctions;
        DWORD NumberOfNames;
        LPDWORD *AddressOfFunctions;
        LPDWORD *AddressOfNames;
        LPWORD *AddressOfNameOrdinals;
} IMAGE_EXPORT_DIRECTORY,*PIMAGE_EXPORT_DIRECTORY;


typedef struct _IMAGE_IMPORT_BY_NAME {
        WORD Hint;
        BYTE Name[1];
} IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME;


typedef struct _IMAGE_THUNK_DATA {
        union {
                LPBYTE ForwarderString;
                FARPROC Function;
                DWORD Ordinal;
                PIMAGE_IMPORT_BY_NAME AddressOfData;
        } u1;
} IMAGE_THUNK_DATA,*PIMAGE_THUNK_DATA;



typedef struct _IMAGE_IMPORT_DESCRIPTOR {
        union {
                DWORD Characteristics;
                PIMAGE_THUNK_DATA OriginalFirstThunk;
        } u;
        DWORD TimeDateStamp;






        DWORD ForwarderChain;
        DWORD Name;

        PIMAGE_THUNK_DATA FirstThunk;
} IMAGE_IMPORT_DESCRIPTOR,*PIMAGE_IMPORT_DESCRIPTOR;





typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR
{
    DWORD TimeDateStamp;
    WORD OffsetModuleName;
    WORD NumberOfModuleForwarderRefs;

} IMAGE_BOUND_IMPORT_DESCRIPTOR, *PIMAGE_BOUND_IMPORT_DESCRIPTOR;

typedef struct _IMAGE_BOUND_FORWARDER_REF
{
    DWORD TimeDateStamp;
    WORD OffsetModuleName;
    WORD Reserved;
} IMAGE_BOUND_FORWARDER_REF, *PIMAGE_BOUND_FORWARDER_REF;

typedef struct _IMAGE_BASE_RELOCATION
{
        DWORD VirtualAddress;
        DWORD SizeOfBlock;
        WORD TypeOffset[1];
} IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION;

typedef struct _IMAGE_RELOCATION
{
    union {
        DWORD VirtualAddress;
        DWORD RelocCount;
    } u;
    DWORD SymbolTableIndex;
    WORD Type;
} IMAGE_RELOCATION;
typedef IMAGE_RELOCATION *PIMAGE_RELOCATION;
typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER
{
    BYTE Name[16];
    BYTE Date[12];
    BYTE UserID[6];
    BYTE GroupID[6];
    BYTE Mode[8];
    BYTE Size[10];
    BYTE EndHeader[2];
} IMAGE_ARCHIVE_MEMBER_HEADER, *PIMAGE_ARCHIVE_MEMBER_HEADER;






typedef struct _IMAGE_RESOURCE_DIRECTORY {
        DWORD Characteristics;
        DWORD TimeDateStamp;
        WORD MajorVersion;
        WORD MinorVersion;
        WORD NumberOfNamedEntries;
        WORD NumberOfIdEntries;

} IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY;




typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
        union {
                struct {
                        unsigned NameOffset:31;
                        unsigned NameIsString:1;
                } s;
                DWORD Name;
                WORD Id;
        } u1;
        union {
                DWORD OffsetToData;
                struct {
                        unsigned OffsetToDirectory:31;
                        unsigned DataIsDirectory:1;
                } s;
        } u2;
} IMAGE_RESOURCE_DIRECTORY_ENTRY,*PIMAGE_RESOURCE_DIRECTORY_ENTRY;


typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING {
        WORD Length;
        CHAR NameString[ 1 ];
} IMAGE_RESOURCE_DIRECTORY_STRING,*PIMAGE_RESOURCE_DIRECTORY_STRING;

typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
        WORD Length;
        WCHAR NameString[ 1 ];
} IMAGE_RESOURCE_DIR_STRING_U,*PIMAGE_RESOURCE_DIR_STRING_U;

typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
        DWORD OffsetToData;
        DWORD Size;
        DWORD CodePage;
        DWORD ResourceHandle;
} IMAGE_RESOURCE_DATA_ENTRY,*PIMAGE_RESOURCE_DATA_ENTRY;


typedef VOID __attribute__((__stdcall__)) (*PIMAGE_TLS_CALLBACK)(
        LPVOID DllHandle,DWORD Reason,LPVOID Reserved
);

typedef struct _IMAGE_TLS_DIRECTORY {
        DWORD StartAddressOfRawData;
        DWORD EndAddressOfRawData;
        LPDWORD AddressOfIndex;
        PIMAGE_TLS_CALLBACK *AddressOfCallBacks;
        DWORD SizeOfZeroFill;
        DWORD Characteristics;
} IMAGE_TLS_DIRECTORY,*PIMAGE_TLS_DIRECTORY;

typedef struct _IMAGE_DEBUG_DIRECTORY {
  DWORD Characteristics;
  DWORD TimeDateStamp;
  WORD MajorVersion;
  WORD MinorVersion;
  DWORD Type;
  DWORD SizeOfData;
  DWORD AddressOfRawData;
  DWORD PointerToRawData;
} IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;
typedef struct _IMAGE_COFF_SYMBOLS_HEADER {
  DWORD NumberOfSymbols;
  DWORD LvaToFirstSymbol;
  DWORD NumberOfLinenumbers;
  DWORD LvaToFirstLinenumber;
  DWORD RvaToFirstByteOfCode;
  DWORD RvaToLastByteOfCode;
  DWORD RvaToFirstByteOfData;
  DWORD RvaToLastByteOfData;
} IMAGE_COFF_SYMBOLS_HEADER, *PIMAGE_COFF_SYMBOLS_HEADER;






typedef struct _FPO_DATA {
  DWORD ulOffStart;
  DWORD cbProcSize;
  DWORD cdwLocals;
  WORD cdwParams;
  unsigned cbProlog : 8;
  unsigned cbRegs : 3;
  unsigned fHasSEH : 1;
  unsigned fUseBP : 1;
  unsigned reserved : 1;
  unsigned cbFrame : 2;
} FPO_DATA, *PFPO_DATA;

typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY {
  DWORD Characteristics;
  DWORD TimeDateStamp;
  WORD MajorVersion;
  WORD MinorVersion;
  DWORD GlobalFlagsClear;
  DWORD GlobalFlagsSet;
  DWORD CriticalSectionDefaultTimeout;
  DWORD DeCommitFreeBlockThreshold;
  DWORD DeCommitTotalFreeThreshold;
  PVOID LockPrefixTable;
  DWORD MaximumAllocationSize;
  DWORD VirtualMemoryThreshold;
  DWORD ProcessHeapFlags;
  DWORD ProcessAffinityMask;
  WORD CSDVersion;
  WORD Reserved1;
  PVOID EditList;
  DWORD Reserved[1];
} IMAGE_LOAD_CONFIG_DIRECTORY, *PIMAGE_LOAD_CONFIG_DIRECTORY;

typedef struct _IMAGE_FUNCTION_ENTRY {
  DWORD StartingAddress;
  DWORD EndingAddress;
  DWORD EndOfPrologue;
} IMAGE_FUNCTION_ENTRY, *PIMAGE_FUNCTION_ENTRY;



typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
        WORD Signature;
        WORD Flags;
        WORD Machine;
        WORD Characteristics;
        DWORD TimeDateStamp;
        DWORD CheckSum;
        DWORD ImageBase;
        DWORD SizeOfImage;
        DWORD NumberOfSections;
        DWORD ExportedNamesSize;
        DWORD DebugDirectorySize;
        DWORD SectionAlignment;
        DWORD Reserved[ 2 ];
} IMAGE_SEPARATE_DEBUG_HEADER,*PIMAGE_SEPARATE_DEBUG_HEADER;




typedef struct tagMESSAGE_RESOURCE_ENTRY {
        WORD Length;
        WORD Flags;
        BYTE Text[1];
} MESSAGE_RESOURCE_ENTRY,*PMESSAGE_RESOURCE_ENTRY;


typedef struct tagMESSAGE_RESOURCE_BLOCK {
        DWORD LowId;
        DWORD HighId;
        DWORD OffsetToEntries;
} MESSAGE_RESOURCE_BLOCK,*PMESSAGE_RESOURCE_BLOCK;

typedef struct tagMESSAGE_RESOURCE_DATA {
        DWORD NumberOfBlocks;
        MESSAGE_RESOURCE_BLOCK Blocks[ 1 ];
} MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA;
typedef PVOID PACCESS_TOKEN;





typedef enum _TOKEN_INFORMATION_CLASS {
  TokenUser = 1,
  TokenGroups,
  TokenPrivileges,
  TokenOwner,
  TokenPrimaryGroup,
  TokenDefaultDacl,
  TokenSource,
  TokenType,
  TokenImpersonationLevel,
  TokenStatistics
} TOKEN_INFORMATION_CLASS;





typedef DWORD ACCESS_MASK, *PACCESS_MASK;

typedef struct _GENERIC_MAPPING {
    ACCESS_MASK GenericRead;
    ACCESS_MASK GenericWrite;
    ACCESS_MASK GenericExecute;
    ACCESS_MASK GenericAll;
} GENERIC_MAPPING, *PGENERIC_MAPPING;



typedef struct {
    BYTE Value[6];
} SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;




typedef struct _SID {
    BYTE Revision;
    BYTE SubAuthorityCount;
    SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
    DWORD SubAuthority[1];
} SID,*PSID;
typedef struct _ACL {
    BYTE AclRevision;
    BYTE Sbz1;
    WORD AclSize;
    WORD AceCount;
    WORD Sbz2;
} ACL, *PACL;
typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION;
typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;


typedef struct {
    BYTE Revision;
    BYTE Sbz1;
    SECURITY_DESCRIPTOR_CONTROL Control;
    DWORD Owner;
    DWORD Group;
    DWORD Sacl;
    DWORD Dacl;
} SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;

typedef struct {
    BYTE Revision;
    BYTE Sbz1;
    SECURITY_DESCRIPTOR_CONTROL Control;
    PSID Owner;
    PSID Group;
    PACL Sacl;
    PACL Dacl;
} SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR;







#pragma pack()








typedef struct _SID_AND_ATTRIBUTES {
  PSID Sid;
  DWORD Attributes;
} SID_AND_ATTRIBUTES ;
typedef struct _TOKEN_USER {
  SID_AND_ATTRIBUTES User;
} TOKEN_USER;





typedef struct _TOKEN_GROUPS {
  DWORD GroupCount;
  SID_AND_ATTRIBUTES Groups[1];
} TOKEN_GROUPS;





typedef union _LARGE_INTEGER {
    struct {
        DWORD LowPart;
        LONG HighPart;
    } s;
    LONGLONG QuadPart;
} LARGE_INTEGER, *LPLARGE_INTEGER, *PLARGE_INTEGER;

typedef union _ULARGE_INTEGER {
    struct {
        DWORD LowPart;
        LONG HighPart;
    } s;
    LONGLONG QuadPart;
} ULARGE_INTEGER, *LPULARGE_INTEGER, *PULARGE_INTEGER;





typedef LARGE_INTEGER LUID,*PLUID;

typedef struct _LUID_AND_ATTRIBUTES {
  LUID Luid;
  DWORD Attributes;
} LUID_AND_ATTRIBUTES;





typedef struct _PRIVILEGE_SET {
    DWORD PrivilegeCount;
    DWORD Control;
    LUID_AND_ATTRIBUTES Privilege[1];
} PRIVILEGE_SET, *PPRIVILEGE_SET;





typedef struct _TOKEN_PRIVILEGES {
  DWORD PrivilegeCount;
  LUID_AND_ATTRIBUTES Privileges[1];
} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES;





typedef struct _TOKEN_OWNER {
  PSID Owner;
} TOKEN_OWNER;





typedef struct _TOKEN_PRIMARY_GROUP {
  PSID PrimaryGroup;
} TOKEN_PRIMARY_GROUP;






typedef struct _TOKEN_DEFAULT_DACL {
  PACL DefaultDacl;
} TOKEN_DEFAULT_DACL;





typedef struct _TOKEN_SOURCE {
  char Sourcename[8];
  LUID SourceIdentifier;
} TOKEN_SOURCE;





typedef enum tagTOKEN_TYPE {
  TokenPrimary = 1,
  TokenImpersonation
} TOKEN_TYPE;





typedef enum _SECURITY_IMPERSONATION_LEVEL {
  SecurityAnonymous,
  SecurityIdentification,
  SecurityImpersonation,
  SecurityDelegation
} SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL;


typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE,
        * PSECURITY_CONTEXT_TRACKING_MODE;




typedef struct _SECURITY_QUALITY_OF_SERVICE {
  DWORD Length;
  SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
  SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
  WIN_BOOL EffectiveOnly;
} SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE;





typedef struct _TOKEN_STATISTICS {
  LUID TokenId;
  LUID AuthenticationId;
  LARGE_INTEGER ExpirationTime;
  TOKEN_TYPE TokenType;
  SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
  DWORD DynamicCharged;
  DWORD DynamicAvailable;
  DWORD GroupCount;
  DWORD PrivilegeCount;
  LUID ModifiedId;
} TOKEN_STATISTICS;
typedef struct _ACE_HEADER {
        BYTE AceType;
        BYTE AceFlags;
        WORD AceSize;
} ACE_HEADER,*PACE_HEADER;
typedef struct _ACCESS_ALLOWED_ACE {
        ACE_HEADER Header;
        DWORD Mask;
        DWORD SidStart;
} ACCESS_ALLOWED_ACE,*PACCESS_ALLOWED_ACE;

typedef struct _ACCESS_DENIED_ACE {
        ACE_HEADER Header;
        DWORD Mask;
        DWORD SidStart;
} ACCESS_DENIED_ACE,*PACCESS_DENIED_ACE;

typedef struct _SYSTEM_AUDIT_ACE {
        ACE_HEADER Header;
        DWORD Mask;
        DWORD SidStart;
} SYSTEM_AUDIT_ACE,*PSYSTEM_AUDIT_ACE;

typedef struct _SYSTEM_ALARM_ACE {
        ACE_HEADER Header;
        DWORD Mask;
        DWORD SidStart;
} SYSTEM_ALARM_ACE,*PSYSTEM_ALARM_ACE;

typedef enum tagSID_NAME_USE {
        SidTypeUser = 1,
        SidTypeGroup,
        SidTypeDomain,
        SidTypeAlias,
        SidTypeWellKnownGroup,
        SidTypeDeletedAccount,
        SidTypeInvalid,
        SidTypeUnknown
} SID_NAME_USE,*PSID_NAME_USE;




#pragma pack()




LPWSTR __attribute__((__stdcall__)) lstrcpyAtoW(LPWSTR,LPCSTR);
LPSTR __attribute__((__stdcall__)) lstrcpyWtoA(LPSTR,LPCWSTR);
LPWSTR __attribute__((__stdcall__)) lstrcpynAtoW(LPWSTR,LPCSTR,INT);
LPSTR __attribute__((__stdcall__)) lstrcpynWtoA(LPSTR,LPCWSTR,INT);






typedef struct tagCOORD {
    INT16 x;
    INT16 y;
} COORD, *LPCOORD;






typedef DWORD __attribute__((__stdcall__)) (*LPTHREAD_START_ROUTINE)(LPVOID);
typedef struct _EXCEPTION_DEBUG_INFO {
    EXCEPTION_RECORD ExceptionRecord;
    DWORD dwFirstChance;
} EXCEPTION_DEBUG_INFO;

typedef struct _CREATE_THREAD_DEBUG_INFO {
    HANDLE hThread;
    LPVOID lpThreadLocalBase;
    LPTHREAD_START_ROUTINE lpStartAddress;
} CREATE_THREAD_DEBUG_INFO;

typedef struct _CREATE_PROCESS_DEBUG_INFO {
    HANDLE hFile;
    HANDLE hProcess;
    HANDLE hThread;
    LPVOID lpBaseOfImage;
    DWORD dwDebugInfoFileOffset;
    DWORD nDebugInfoSize;
    LPVOID lpThreadLocalBase;
    LPTHREAD_START_ROUTINE lpStartAddress;
    LPVOID lpImageName;
    WORD fUnicode;
} CREATE_PROCESS_DEBUG_INFO;

typedef struct _EXIT_THREAD_DEBUG_INFO {
    DWORD dwExitCode;
} EXIT_THREAD_DEBUG_INFO;

typedef struct _EXIT_PROCESS_DEBUG_INFO {
    DWORD dwExitCode;
} EXIT_PROCESS_DEBUG_INFO;

typedef struct _LOAD_DLL_DEBUG_INFO {
    HANDLE hFile;
    LPVOID lpBaseOfDll;
    DWORD dwDebugInfoFileOffset;
    DWORD nDebugInfoSize;
    LPVOID lpImageName;
    WORD fUnicode;
} LOAD_DLL_DEBUG_INFO;

typedef struct _UNLOAD_DLL_DEBUG_INFO {
    LPVOID lpBaseOfDll;
} UNLOAD_DLL_DEBUG_INFO;

typedef struct _OUTPUT_DEBUG_STRING_INFO {
    LPSTR lpDebugStringData;
    WORD fUnicode;
    WORD nDebugStringLength;
} OUTPUT_DEBUG_STRING_INFO;

typedef struct _RIP_INFO {
    DWORD dwError;
    DWORD dwType;
} RIP_INFO;

typedef struct _DEBUG_EVENT {
    DWORD dwDebugEventCode;
    DWORD dwProcessId;
    DWORD dwThreadId;
    union {
        EXCEPTION_DEBUG_INFO Exception;
        CREATE_THREAD_DEBUG_INFO CreateThread;
        CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
        EXIT_THREAD_DEBUG_INFO ExitThread;
        EXIT_PROCESS_DEBUG_INFO ExitProcess;
        LOAD_DLL_DEBUG_INFO LoadDll;
        UNLOAD_DLL_DEBUG_INFO UnloadDll;
        OUTPUT_DEBUG_STRING_INFO DebugString;
        RIP_INFO RipInfo;
    } u;
} DEBUG_EVENT, *LPDEBUG_EVENT;


typedef struct
{
    BYTE cBytes;
    BYTE fFixedDisk;
    WORD nErrCode;
    BYTE reserved[4];
    BYTE szPathName[128];
} OFSTRUCT, *LPOFSTRUCT;
typedef struct _SECURITY_ATTRIBUTES
{
    DWORD nLength;
    LPVOID lpSecurityDescriptor;
    WIN_BOOL bInheritHandle;
} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;




typedef struct
{
  DWORD dwLowDateTime;
  DWORD dwHighDateTime;
} FILETIME, *LPFILETIME;



typedef struct
{
    DWORD dwFileAttributes;
    FILETIME ftCreationTime;
    FILETIME ftLastAccessTime;
    FILETIME ftLastWriteTime;
    DWORD nFileSizeHigh;
    DWORD nFileSizeLow;
    DWORD dwReserved0;
    DWORD dwReserved1;
    CHAR cFileName[260];
    CHAR cAlternateFileName[14];
} WIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;

typedef struct
{
    DWORD dwFileAttributes;
    FILETIME ftCreationTime;
    FILETIME ftLastAccessTime;
    FILETIME ftLastWriteTime;
    DWORD nFileSizeHigh;
    DWORD nFileSizeLow;
    DWORD dwReserved0;
    DWORD dwReserved1;
    WCHAR cFileName[260];
    WCHAR cAlternateFileName[14];
} WIN32_FIND_DATAW, *LPWIN32_FIND_DATAW;

typedef WIN32_FIND_DATAA WIN32_FIND_DATA;
typedef LPWIN32_FIND_DATAA LPWIN32_FIND_DATA;

typedef struct
{
    LPVOID lpData;
    DWORD cbData;
    BYTE cbOverhead;
    BYTE iRegionIndex;
    WORD wFlags;
    union {
        struct {
            HANDLE hMem;
            DWORD dwReserved[3];
        } Block;
        struct {
            DWORD dwCommittedSize;
            DWORD dwUnCommittedSize;
            LPVOID lpFirstBlock;
            LPVOID lpLastBlock;
        } Region;
    } Foo;
} PROCESS_HEAP_ENTRY, *LPPROCESS_HEAP_ENTRY;
typedef struct tagMEMORYSTATUS
{
    DWORD dwLength;
    DWORD dwMemoryLoad;
    DWORD dwTotalPhys;
    DWORD dwAvailPhys;
    DWORD dwTotalPageFile;
    DWORD dwAvailPageFile;
    DWORD dwTotalVirtual;
    DWORD dwAvailVirtual;
} MEMORYSTATUS, *LPMEMORYSTATUS;
typedef struct
{
    UINT16 flags;
    DWORD dwOptions __attribute__((packed));
    DWORD dwFilter __attribute__((packed));
    CHAR achAllocModule[8] __attribute__((packed));
    DWORD dwAllocBreak __attribute__((packed));
    DWORD dwAllocCount __attribute__((packed));
} WINDEBUGINFO, *LPWINDEBUGINFO;
typedef struct {
        WORD wYear;
        WORD wMonth;
        WORD wDayOfWeek;
        WORD wDay;
        WORD wHour;
        WORD wMinute;
        WORD wSecond;
        WORD wMilliseconds;
} SYSTEMTIME, *LPSYSTEMTIME;



typedef struct {
        DWORD Internal;
        DWORD InternalHigh;
        DWORD Offset;
        DWORD OffsetHigh;
        HANDLE hEvent;
} OVERLAPPED, *LPOVERLAPPED;
typedef struct {
        DWORD cb;
        LPSTR lpReserved;
        LPSTR lpDesktop;
        LPSTR lpTitle;
        DWORD dwX;
        DWORD dwY;
        DWORD dwXSize;
        DWORD dwYSize;
        DWORD dwXCountChars;
        DWORD dwYCountChars;
        DWORD dwFillAttribute;
        DWORD dwFlags;
        WORD wShowWindow;
        WORD cbReserved2;
        BYTE *lpReserved2;
        HANDLE hStdInput;
        HANDLE hStdOutput;
        HANDLE hStdError;
} STARTUPINFOA, *LPSTARTUPINFOA;

typedef struct {
        DWORD cb;
        LPWSTR lpReserved;
        LPWSTR lpDesktop;
        LPWSTR lpTitle;
        DWORD dwX;
        DWORD dwY;
        DWORD dwXSize;
        DWORD dwYSize;
        DWORD dwXCountChars;
        DWORD dwYCountChars;
        DWORD dwFillAttribute;
        DWORD dwFlags;
        WORD wShowWindow;
        WORD cbReserved2;
        BYTE *lpReserved2;
        HANDLE hStdInput;
        HANDLE hStdOutput;
        HANDLE hStdError;
} STARTUPINFOW, *LPSTARTUPINFOW;

typedef STARTUPINFOA STARTUPINFO;
typedef LPSTARTUPINFOA LPSTARTUPINFO;

typedef struct {
        HANDLE hProcess;
        HANDLE hThread;
        DWORD dwProcessId;
        DWORD dwThreadId;
} PROCESS_INFORMATION,*LPPROCESS_INFORMATION;

typedef struct {
        LONG Bias;
        WCHAR StandardName[32];
        SYSTEMTIME StandardDate;
        LONG StandardBias;
        WCHAR DaylightName[32];
        SYSTEMTIME DaylightDate;
        LONG DaylightBias;
} TIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
typedef struct
{
  int dwFileAttributes;
  FILETIME ftCreationTime;
  FILETIME ftLastAccessTime;
  FILETIME ftLastWriteTime;
  int dwVolumeSerialNumber;
  int nFileSizeHigh;
  int nFileSizeLow;
  int nNumberOfLinks;
  int nFileIndexHigh;
  int nFileIndexLow;
} BY_HANDLE_FILE_INFORMATION ;


typedef struct _SYSTEM_POWER_STATUS
{
  WIN_BOOL16 ACLineStatus;
  BYTE BatteryFlag;
  BYTE BatteryLifePercent;
  BYTE reserved;
  DWORD BatteryLifeTime;
  DWORD BatteryFullLifeTime;
} SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS;

typedef struct _MEMORY_BASIC_INFORMATION
{
    LPVOID BaseAddress;
    LPVOID AllocationBase;
    DWORD AllocationProtect;
    DWORD RegionSize;
    DWORD State;
    DWORD Protect;
    DWORD Type;
} MEMORY_BASIC_INFORMATION,*LPMEMORY_BASIC_INFORMATION;


typedef WIN_BOOL __attribute__((__stdcall__)) (*CODEPAGE_ENUMPROCA)(LPSTR);
typedef WIN_BOOL __attribute__((__stdcall__)) (*CODEPAGE_ENUMPROCW)(LPWSTR);
typedef CODEPAGE_ENUMPROCA CODEPAGE_ENUMPROC;
typedef WIN_BOOL __attribute__((__stdcall__)) (*LOCALE_ENUMPROCA)(LPSTR);
typedef WIN_BOOL __attribute__((__stdcall__)) (*LOCALE_ENUMPROCW)(LPWSTR);
typedef LOCALE_ENUMPROCA LOCALE_ENUMPROC;

typedef struct tagSYSTEM_INFO
{
    union {
        DWORD dwOemId;
        struct {
                WORD wProcessorArchitecture;
                WORD wReserved;
        } s;
    } u;
    DWORD dwPageSize;
    LPVOID lpMinimumApplicationAddress;
    LPVOID lpMaximumApplicationAddress;
    DWORD dwActiveProcessorMask;
    DWORD dwNumberOfProcessors;
    DWORD dwProcessorType;
    DWORD dwAllocationGranularity;
    WORD wProcessorLevel;
    WORD wProcessorRevision;
} SYSTEM_INFO, *LPSYSTEM_INFO;







typedef WIN_BOOL __attribute__((__stdcall__)) (*ENUMRESTYPEPROCA)(HMODULE,LPSTR,LONG);
typedef WIN_BOOL __attribute__((__stdcall__)) (*ENUMRESTYPEPROCW)(HMODULE,LPWSTR,LONG);
typedef WIN_BOOL __attribute__((__stdcall__)) (*ENUMRESNAMEPROCA)(HMODULE,LPCSTR,LPSTR,LONG);
typedef WIN_BOOL __attribute__((__stdcall__)) (*ENUMRESNAMEPROCW)(HMODULE,LPCWSTR,LPWSTR,LONG);
typedef WIN_BOOL __attribute__((__stdcall__)) (*ENUMRESLANGPROCA)(HMODULE,LPCSTR,LPCSTR,WORD,LONG);
typedef WIN_BOOL __attribute__((__stdcall__)) (*ENUMRESLANGPROCW)(HMODULE,LPCWSTR,LPCWSTR,WORD,LONG);

typedef ENUMRESTYPEPROCA ENUMRESTYPEPROC;
typedef ENUMRESNAMEPROCA ENUMRESNAMEPROC;
typedef ENUMRESLANGPROCA ENUMRESLANGPROC;







typedef struct _LDT_ENTRY {
    WORD LimitLow;
    WORD BaseLow;
    union {
        struct {
            BYTE BaseMid;
            BYTE Flags1;
            BYTE Flags2;
            BYTE BaseHi;
        } Bytes;
        struct {
            unsigned BaseMid : 8;
            unsigned Type : 5;
            unsigned Dpl : 2;
            unsigned Pres : 1;
            unsigned LimitHi : 4;
            unsigned Sys : 1;
            unsigned Reserved_0 : 1;
            unsigned Default_Big : 1;
            unsigned Granularity : 1;
            unsigned BaseHi : 8;
        } Bits;
    } HighWord;
} LDT_ENTRY, *LPLDT_ENTRY;


typedef enum _GET_FILEEX_INFO_LEVELS {
    GetFileExInfoStandard
} GET_FILEEX_INFO_LEVELS;

typedef struct _WIN32_FILE_ATTRIBUTES_DATA {
    DWORD dwFileAttributes;
    FILETIME ftCreationTime;
    FILETIME ftLastAccessTime;
    FILETIME ftLastWriteTime;
    DWORD nFileSizeHigh;
    DWORD nFileSizeLow;
} WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;

typedef struct _DllVersionInfo {
    DWORD cbSize;
    DWORD dwMajorVersion;
    DWORD dwMinorVersion;
    DWORD dwBuildNumber;
    DWORD dwPlatformID;
} DLLVERSIONINFO;





typedef DWORD __attribute__((__stdcall__)) (*LPPROGRESS_ROUTINE)(LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER,
                                           LARGE_INTEGER, DWORD, DWORD, HANDLE,
                                           HANDLE, LPVOID);
typedef struct {
        LPVOID DebugInfo;
        LONG LockCount;
        LONG RecursionCount;
        HANDLE OwningThread;
        HANDLE LockSemaphore;
        DWORD Reserved;
}CRITICAL_SECTION;





typedef struct {
        DWORD dwOSVersionInfoSize;
        DWORD dwMajorVersion;
        DWORD dwMinorVersion;
        DWORD dwBuildNumber;
        DWORD dwPlatformId;
        CHAR szCSDVersion[128];
} OSVERSIONINFO16;

typedef struct {
        DWORD dwOSVersionInfoSize;
        DWORD dwMajorVersion;
        DWORD dwMinorVersion;
        DWORD dwBuildNumber;
        DWORD dwPlatformId;
        CHAR szCSDVersion[128];
} OSVERSIONINFOA;

typedef struct {
        DWORD dwOSVersionInfoSize;
        DWORD dwMajorVersion;
        DWORD dwMinorVersion;
        DWORD dwBuildNumber;
        DWORD dwPlatformId;
        WCHAR szCSDVersion[128];
} OSVERSIONINFOW;

typedef OSVERSIONINFOA OSVERSIONINFO;





typedef struct tagCOMSTAT
{
    DWORD status;
    DWORD cbInQue;
    DWORD cbOutQue;
} COMSTAT,*LPCOMSTAT;

typedef struct tagDCB
{
    DWORD DCBlength;
    DWORD BaudRate;
    unsigned fBinary :1;
    unsigned fParity :1;
    unsigned fOutxCtsFlow :1;
    unsigned fOutxDsrFlow :1;
    unsigned fDtrControl :2;
    unsigned fDsrSensitivity :1;
    unsigned fTXContinueOnXoff :1;
    unsigned fOutX :1;
    unsigned fInX :1;
    unsigned fErrorChar :1;
    unsigned fNull :1;
    unsigned fRtsControl :2;
    unsigned fAbortOnError :1;
    unsigned fDummy2 :17;
    WORD wReserved;
    WORD XonLim;
    WORD XoffLim;
    BYTE ByteSize;
    BYTE Parity;
    BYTE StopBits;
    char XonChar;
    char XoffChar;
    char ErrorChar;
    char EofChar;
    char EvtChar;
} DCB, *LPDCB;



typedef struct tagCOMMTIMEOUTS {
        DWORD ReadIntervalTimeout;
        DWORD ReadTotalTimeoutMultiplier;
        DWORD ReadTotalTimeoutConstant;
        DWORD WriteTotalTimeoutMultiplier;
        DWORD WriteTotalTimeoutConstant;
} COMMTIMEOUTS,*LPCOMMTIMEOUTS;





#pragma pack()

typedef void __attribute__((__stdcall__)) (*PAPCFUNC)(ULONG_PTR);
typedef void __attribute__((__stdcall__)) (*PTIMERAPCROUTINE)(LPVOID,DWORD,DWORD);

WIN_BOOL __attribute__((__stdcall__)) ClearCommError(INT,LPDWORD,LPCOMSTAT);
WIN_BOOL __attribute__((__stdcall__)) BuildCommDCBA(LPCSTR,LPDCB);
WIN_BOOL __attribute__((__stdcall__)) BuildCommDCBW(LPCWSTR,LPDCB);

WIN_BOOL __attribute__((__stdcall__)) BuildCommDCBAndTimeoutsA(LPCSTR,LPDCB,LPCOMMTIMEOUTS);
WIN_BOOL __attribute__((__stdcall__)) BuildCommDCBAndTimeoutsW(LPCWSTR,LPDCB,LPCOMMTIMEOUTS);

WIN_BOOL __attribute__((__stdcall__)) GetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
WIN_BOOL __attribute__((__stdcall__)) SetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
WIN_BOOL __attribute__((__stdcall__)) GetCommState(INT,LPDCB);
WIN_BOOL __attribute__((__stdcall__)) SetCommState(INT,LPDCB);
WIN_BOOL __attribute__((__stdcall__)) TransmitCommChar(INT,CHAR);
WIN_BOOL __attribute__((__stdcall__)) SetupComm(HANDLE, DWORD, DWORD);
WIN_BOOL __attribute__((__stdcall__)) GetCommProperties(HANDLE, LPDCB *);


WIN_BOOL16 __attribute__((__stdcall__)) GetVersionEx16(OSVERSIONINFO16*);
WIN_BOOL __attribute__((__stdcall__)) GetVersionExA(OSVERSIONINFOA*);
WIN_BOOL __attribute__((__stdcall__)) GetVersionExW(OSVERSIONINFOW*);




void __attribute__((__stdcall__)) DeleteCriticalSection(CRITICAL_SECTION *lpCrit);
void __attribute__((__stdcall__)) EnterCriticalSection(CRITICAL_SECTION *lpCrit);
WIN_BOOL __attribute__((__stdcall__)) TryEnterCriticalSection(CRITICAL_SECTION *lpCrit);
void __attribute__((__stdcall__)) InitializeCriticalSection(CRITICAL_SECTION *lpCrit);
void __attribute__((__stdcall__)) LeaveCriticalSection(CRITICAL_SECTION *lpCrit);
void __attribute__((__stdcall__)) MakeCriticalSectionGlobal(CRITICAL_SECTION *lpCrit);
WIN_BOOL __attribute__((__stdcall__)) GetProcessWorkingSetSize(HANDLE,LPDWORD,LPDWORD);
DWORD __attribute__((__stdcall__)) QueueUserAPC(PAPCFUNC,HANDLE,ULONG_PTR);
void __attribute__((__stdcall__)) RaiseException(DWORD,DWORD,DWORD,const LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) SetProcessWorkingSetSize(HANDLE,DWORD,DWORD);
WIN_BOOL __attribute__((__stdcall__)) TerminateProcess(HANDLE,DWORD);
WIN_BOOL __attribute__((__stdcall__)) TerminateThread(HANDLE,DWORD);
WIN_BOOL __attribute__((__stdcall__)) GetExitCodeThread(HANDLE,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetBinaryTypeA( LPCSTR lpApplicationName, LPDWORD lpBinaryType );
WIN_BOOL __attribute__((__stdcall__)) GetBinaryTypeW( LPCWSTR lpApplicationName, LPDWORD lpBinaryType );


WIN_BOOL16 __attribute__((__stdcall__)) GetWinDebugInfo16(LPWINDEBUGINFO,UINT16);
WIN_BOOL16 __attribute__((__stdcall__)) SetWinDebugInfo16(LPWINDEBUGINFO);



WIN_BOOL __attribute__((__stdcall__)) AttachThreadInput(DWORD,DWORD,WIN_BOOL);
WIN_BOOL __attribute__((__stdcall__)) AccessCheck(PSECURITY_DESCRIPTOR,HANDLE,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,LPDWORD,LPDWORD,LPWIN_BOOL);
WIN_BOOL __attribute__((__stdcall__)) AdjustTokenPrivileges(HANDLE,WIN_BOOL,LPVOID,DWORD,LPVOID,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
WIN_BOOL __attribute__((__stdcall__)) AllocateLocallyUniqueId(PLUID);
WIN_BOOL __attribute__((__stdcall__)) AllocConsole(void);
WIN_BOOL __attribute__((__stdcall__)) AreFileApisANSI(void);
WIN_BOOL __attribute__((__stdcall__)) BackupEventLogA(HANDLE,LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) BackupEventLogW(HANDLE,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) Beep(DWORD,DWORD);
WIN_BOOL __attribute__((__stdcall__)) CancelWaitableTimer(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) ClearEventLogA(HANDLE,LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) ClearEventLogW(HANDLE,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) CloseEventLog(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) CloseHandle(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) ContinueDebugEvent(DWORD,DWORD,DWORD);
HANDLE __attribute__((__stdcall__)) ConvertToGlobalHandle(HANDLE hSrc);
WIN_BOOL __attribute__((__stdcall__)) CopyFileA(LPCSTR,LPCSTR,WIN_BOOL);
WIN_BOOL __attribute__((__stdcall__)) CopyFileW(LPCWSTR,LPCWSTR,WIN_BOOL);

WIN_BOOL __attribute__((__stdcall__)) CopyFileExA(LPCSTR, LPCSTR, LPPROGRESS_ROUTINE, LPVOID, LPWIN_BOOL, DWORD);
WIN_BOOL __attribute__((__stdcall__)) CopyFileExW(LPCWSTR, LPCWSTR, LPPROGRESS_ROUTINE, LPVOID, LPWIN_BOOL, DWORD);

WIN_BOOL __attribute__((__stdcall__)) CopySid(DWORD,PSID,PSID);
INT __attribute__((__stdcall__)) CompareFileTime(LPFILETIME,LPFILETIME);
HANDLE __attribute__((__stdcall__)) CreateEventA(LPSECURITY_ATTRIBUTES,WIN_BOOL,WIN_BOOL,LPCSTR);
HANDLE __attribute__((__stdcall__)) CreateEventW(LPSECURITY_ATTRIBUTES,WIN_BOOL,WIN_BOOL,LPCWSTR);

HANDLE __attribute__((__stdcall__)) CreateFileA(LPCSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,
                                 DWORD,DWORD,HANDLE);
HANDLE __attribute__((__stdcall__)) CreateFileW(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,
                                 DWORD,DWORD,HANDLE);

HANDLE __attribute__((__stdcall__)) CreateFileMappingA(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,
                                        DWORD,DWORD,LPCSTR);
HANDLE __attribute__((__stdcall__)) CreateFileMappingW(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,
                                        DWORD,DWORD,LPCWSTR);

HANDLE __attribute__((__stdcall__)) CreateMutexA(LPSECURITY_ATTRIBUTES,WIN_BOOL,LPCSTR);
HANDLE __attribute__((__stdcall__)) CreateMutexW(LPSECURITY_ATTRIBUTES,WIN_BOOL,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) CreatePipe(PHANDLE,PHANDLE,LPSECURITY_ATTRIBUTES,DWORD);
WIN_BOOL __attribute__((__stdcall__)) CreateProcessA(LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,
                                    LPSECURITY_ATTRIBUTES,WIN_BOOL,DWORD,LPVOID,LPCSTR,
                                    LPSTARTUPINFOA,LPPROCESS_INFORMATION);
WIN_BOOL __attribute__((__stdcall__)) CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,
                                    LPSECURITY_ATTRIBUTES,WIN_BOOL,DWORD,LPVOID,LPCWSTR,
                                    LPSTARTUPINFOW,LPPROCESS_INFORMATION);

HANDLE __attribute__((__stdcall__)) CreateSemaphoreA(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR);
HANDLE __attribute__((__stdcall__)) CreateSemaphoreW(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR);

HANDLE __attribute__((__stdcall__)) CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
HANDLE __attribute__((__stdcall__)) CreateWaitableTimerA(LPSECURITY_ATTRIBUTES,WIN_BOOL,LPCSTR);
HANDLE __attribute__((__stdcall__)) CreateWaitableTimerW(LPSECURITY_ATTRIBUTES,WIN_BOOL,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) DebugActiveProcess(DWORD);
void __attribute__((__stdcall__)) DebugBreak(void);
WIN_BOOL __attribute__((__stdcall__)) DeregisterEventSource(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) DisableThreadLibraryCalls(HMODULE);
WIN_BOOL __attribute__((__stdcall__)) DosDateTimeToFileTime(WORD,WORD,LPFILETIME);
WIN_BOOL __attribute__((__stdcall__)) DuplicateHandle(HANDLE,HANDLE,HANDLE,HANDLE*,DWORD,WIN_BOOL,DWORD);
WIN_BOOL __attribute__((__stdcall__)) EnumDateFormatsA(DATEFMT_ENUMPROCA lpDateFmtEnumProc, LCID Locale, DWORD dwFlags);
WIN_BOOL __attribute__((__stdcall__)) EnumDateFormatsW(DATEFMT_ENUMPROCW lpDateFmtEnumProc, LCID Locale, DWORD dwFlags);

WIN_BOOL __attribute__((__stdcall__)) EnumResourceLanguagesA(HMODULE,LPCSTR,LPCSTR,
                                            ENUMRESLANGPROCA,LONG);
WIN_BOOL __attribute__((__stdcall__)) EnumResourceLanguagesW(HMODULE,LPCWSTR,LPCWSTR,
                                            ENUMRESLANGPROCW,LONG);

WIN_BOOL __attribute__((__stdcall__)) EnumResourceNamesA(HMODULE,LPCSTR,ENUMRESNAMEPROCA,
                                        LONG);
WIN_BOOL __attribute__((__stdcall__)) EnumResourceNamesW(HMODULE,LPCWSTR,ENUMRESNAMEPROCW,
                                        LONG);

WIN_BOOL __attribute__((__stdcall__)) EnumResourceTypesA(HMODULE,ENUMRESTYPEPROCA,LONG);
WIN_BOOL __attribute__((__stdcall__)) EnumResourceTypesW(HMODULE,ENUMRESTYPEPROCW,LONG);

WIN_BOOL __attribute__((__stdcall__)) EnumSystemCodePagesA(CODEPAGE_ENUMPROCA,DWORD);
WIN_BOOL __attribute__((__stdcall__)) EnumSystemCodePagesW(CODEPAGE_ENUMPROCW,DWORD);

WIN_BOOL __attribute__((__stdcall__)) EnumSystemLocalesA(LOCALE_ENUMPROCA,DWORD);
WIN_BOOL __attribute__((__stdcall__)) EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD);

WIN_BOOL __attribute__((__stdcall__)) EnumTimeFormatsA(TIMEFMT_ENUMPROCA lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags);
WIN_BOOL __attribute__((__stdcall__)) EnumTimeFormatsW(TIMEFMT_ENUMPROCW lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags);

WIN_BOOL __attribute__((__stdcall__)) EqualSid(PSID, PSID);
WIN_BOOL __attribute__((__stdcall__)) EqualPrefixSid(PSID,PSID);
VOID __attribute__((__stdcall__)) ExitProcess(DWORD) __attribute__((noreturn));
VOID __attribute__((__stdcall__)) ExitThread(DWORD) __attribute__((noreturn));
DWORD __attribute__((__stdcall__)) ExpandEnvironmentStringsA(LPCSTR,LPSTR,DWORD);
DWORD __attribute__((__stdcall__)) ExpandEnvironmentStringsW(LPCWSTR,LPWSTR,DWORD);

WIN_BOOL __attribute__((__stdcall__)) FileTimeToDosDateTime(const FILETIME*,LPWORD,LPWORD);
WIN_BOOL __attribute__((__stdcall__)) FileTimeToLocalFileTime(const FILETIME*,LPFILETIME);
WIN_BOOL __attribute__((__stdcall__)) FileTimeToSystemTime(const FILETIME*,LPSYSTEMTIME);
HANDLE __attribute__((__stdcall__)) FindFirstChangeNotificationA(LPCSTR,WIN_BOOL,DWORD);
HANDLE __attribute__((__stdcall__)) FindFirstChangeNotificationW(LPCWSTR,WIN_BOOL,DWORD);

WIN_BOOL __attribute__((__stdcall__)) FindNextChangeNotification(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) FindCloseChangeNotification(HANDLE);
HRSRC __attribute__((__stdcall__)) FindResourceExA(HMODULE,LPCSTR,LPCSTR,WORD);
HRSRC __attribute__((__stdcall__)) FindResourceExW(HMODULE,LPCWSTR,LPCWSTR,WORD);

WIN_BOOL __attribute__((__stdcall__)) FlushConsoleInputBuffer(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) FlushFileBuffers(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) FlushViewOfFile(LPCVOID, DWORD);
DWORD __attribute__((__stdcall__)) FormatMessageA(DWORD,LPCVOID,DWORD,DWORD,LPSTR,
                                    DWORD,LPDWORD);
DWORD __attribute__((__stdcall__)) FormatMessageW(DWORD,LPCVOID,DWORD,DWORD,LPWSTR,
                                    DWORD,LPDWORD);

WIN_BOOL __attribute__((__stdcall__)) FreeConsole(void);
WIN_BOOL __attribute__((__stdcall__)) FreeEnvironmentStringsA(LPSTR);
WIN_BOOL __attribute__((__stdcall__)) FreeEnvironmentStringsW(LPWSTR);

PVOID __attribute__((__stdcall__)) FreeSid(PSID);
UINT __attribute__((__stdcall__)) GetACP(void);
LPCSTR __attribute__((__stdcall__)) GetCommandLineA(void);
LPCWSTR __attribute__((__stdcall__)) GetCommandLineW(void);

WIN_BOOL __attribute__((__stdcall__)) GetComputerNameA(LPSTR,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetComputerNameW(LPWSTR,LPDWORD);

UINT __attribute__((__stdcall__)) GetConsoleCP(void);
WIN_BOOL __attribute__((__stdcall__)) GetConsoleMode(HANDLE,LPDWORD);
UINT __attribute__((__stdcall__)) GetConsoleOutputCP(void);
DWORD __attribute__((__stdcall__)) GetConsoleTitleA(LPSTR,DWORD);
DWORD __attribute__((__stdcall__)) GetConsoleTitleW(LPWSTR,DWORD);

WIN_BOOL __attribute__((__stdcall__)) GetCommMask(HANDLE, LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetCommModemStatus(HANDLE, LPDWORD);
HANDLE __attribute__((__stdcall__)) GetCurrentProcess(void);
HANDLE __attribute__((__stdcall__)) GetCurrentThread(void);
INT __attribute__((__stdcall__)) GetDateFormatA(LCID,DWORD,LPSYSTEMTIME,LPCSTR,LPSTR,INT);
INT __attribute__((__stdcall__)) GetDateFormatW(LCID,DWORD,LPSYSTEMTIME,LPCWSTR,LPWSTR,INT);

LPSTR __attribute__((__stdcall__)) GetEnvironmentStringsA(void);
LPWSTR __attribute__((__stdcall__)) GetEnvironmentStringsW(void);

DWORD __attribute__((__stdcall__)) GetEnvironmentVariableA(LPCSTR,LPSTR,DWORD);
DWORD __attribute__((__stdcall__)) GetEnvironmentVariableW(LPCWSTR,LPWSTR,DWORD);

WIN_BOOL __attribute__((__stdcall__)) GetFileAttributesExA(LPCSTR,GET_FILEEX_INFO_LEVELS,LPVOID);
WIN_BOOL __attribute__((__stdcall__)) GetFileAttributesExW(LPCWSTR,GET_FILEEX_INFO_LEVELS,LPVOID);

DWORD __attribute__((__stdcall__)) GetFileInformationByHandle(HANDLE,BY_HANDLE_FILE_INFORMATION*);
WIN_BOOL __attribute__((__stdcall__)) GetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);

DWORD __attribute__((__stdcall__)) GetFileSize(HANDLE,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetFileTime(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME);
DWORD __attribute__((__stdcall__)) GetFileType(HANDLE);
DWORD __attribute__((__stdcall__)) GetFullPathNameA(LPCSTR,DWORD,LPSTR,LPSTR*);
DWORD __attribute__((__stdcall__)) GetFullPathNameW(LPCWSTR,DWORD,LPWSTR,LPWSTR*);

WIN_BOOL __attribute__((__stdcall__)) GetHandleInformation(HANDLE,LPDWORD);
COORD __attribute__((__stdcall__)) GetLargestConsoleWindowSize(HANDLE);
DWORD __attribute__((__stdcall__)) GetLengthSid(PSID);
VOID __attribute__((__stdcall__)) GetLocalTime(LPSYSTEMTIME);
DWORD __attribute__((__stdcall__)) GetLogicalDrives(void);
DWORD __attribute__((__stdcall__)) GetLongPathNameA(LPCSTR,LPSTR,DWORD);
DWORD __attribute__((__stdcall__)) GetLongPathNameW(LPCWSTR,LPWSTR,DWORD);

WIN_BOOL __attribute__((__stdcall__)) GetNumberOfConsoleInputEvents(HANDLE,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetNumberOfConsoleMouseButtons(LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetNumberOfEventLogRecords(HANDLE,PDWORD);
UINT __attribute__((__stdcall__)) GetOEMCP(void);
WIN_BOOL __attribute__((__stdcall__)) GetOldestEventLogRecord(HANDLE,PDWORD);
DWORD __attribute__((__stdcall__)) GetPriorityClass(HANDLE);
DWORD __attribute__((__stdcall__)) GetProcessVersion(DWORD);
WIN_BOOL __attribute__((__stdcall__)) GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,LPWIN_BOOL,PACL *,LPWIN_BOOL);
WIN_BOOL __attribute__((__stdcall__)) GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID *,LPWIN_BOOL);
DWORD __attribute__((__stdcall__)) GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR);
WIN_BOOL __attribute__((__stdcall__)) GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID *,LPWIN_BOOL);
WIN_BOOL __attribute__((__stdcall__)) GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,LPWIN_BOOL,PACL *,LPWIN_BOOL);
PSID_IDENTIFIER_AUTHORITY __attribute__((__stdcall__)) GetSidIdentifierAuthority(PSID);
DWORD __attribute__((__stdcall__)) GetSidLengthRequired(BYTE);
PDWORD __attribute__((__stdcall__)) GetSidSubAuthority(PSID,DWORD);
PUCHAR __attribute__((__stdcall__)) GetSidSubAuthorityCount(PSID);
DWORD __attribute__((__stdcall__)) GetShortPathNameA(LPCSTR,LPSTR,DWORD);
DWORD __attribute__((__stdcall__)) GetShortPathNameW(LPCWSTR,LPWSTR,DWORD);

HFILE __attribute__((__stdcall__)) GetStdHandle(DWORD);
WIN_BOOL __attribute__((__stdcall__)) GetStringTypeExA(LCID,DWORD,LPCSTR,INT,LPWORD);
WIN_BOOL __attribute__((__stdcall__)) GetStringTypeExW(LCID,DWORD,LPCWSTR,INT,LPWORD);

VOID __attribute__((__stdcall__)) GetSystemInfo(LPSYSTEM_INFO);
WIN_BOOL __attribute__((__stdcall__)) GetSystemPowerStatus(LPSYSTEM_POWER_STATUS);
VOID __attribute__((__stdcall__)) GetSystemTime(LPSYSTEMTIME);
VOID __attribute__((__stdcall__)) GetSystemTimeAsFileTime(LPFILETIME);
INT __attribute__((__stdcall__)) GetTimeFormatA(LCID,DWORD,LPSYSTEMTIME,LPCSTR,LPSTR,INT);
INT __attribute__((__stdcall__)) GetTimeFormatW(LCID,DWORD,LPSYSTEMTIME,LPCWSTR,LPWSTR,INT);

WIN_BOOL __attribute__((__stdcall__)) GetThreadContext(HANDLE,CONTEXT *);
LCID __attribute__((__stdcall__)) GetThreadLocale(void);
INT __attribute__((__stdcall__)) GetThreadPriority(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) GetThreadSelectorEntry(HANDLE,DWORD,LPLDT_ENTRY);
WIN_BOOL __attribute__((__stdcall__)) GetThreadTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME);
WIN_BOOL __attribute__((__stdcall__)) GetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,LPVOID,DWORD,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetUserNameA(LPSTR,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetUserNameW(LPWSTR,LPDWORD);

VOID __attribute__((__stdcall__)) GlobalMemoryStatus(LPMEMORYSTATUS);
LPVOID __attribute__((__stdcall__)) HeapAlloc(HANDLE,DWORD,DWORD);
DWORD __attribute__((__stdcall__)) HeapCompact(HANDLE,DWORD);
HANDLE __attribute__((__stdcall__)) HeapCreate(DWORD,DWORD,DWORD);
WIN_BOOL __attribute__((__stdcall__)) HeapDestroy(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) HeapFree(HANDLE,DWORD,LPVOID);
WIN_BOOL __attribute__((__stdcall__)) HeapLock(HANDLE);
LPVOID __attribute__((__stdcall__)) HeapReAlloc(HANDLE,DWORD,LPVOID,DWORD);
DWORD __attribute__((__stdcall__)) HeapSize(HANDLE,DWORD,LPVOID);
WIN_BOOL __attribute__((__stdcall__)) HeapUnlock(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) HeapValidate(HANDLE,DWORD,LPCVOID);
WIN_BOOL __attribute__((__stdcall__)) HeapWalk(HANDLE,LPPROCESS_HEAP_ENTRY);
WIN_BOOL __attribute__((__stdcall__)) InitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
WIN_BOOL __attribute__((__stdcall__)) IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
WIN_BOOL __attribute__((__stdcall__)) IsValidSid(PSID);
WIN_BOOL __attribute__((__stdcall__)) ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
WIN_BOOL __attribute__((__stdcall__)) IsDBCSLeadByteEx(UINT,BYTE);
WIN_BOOL __attribute__((__stdcall__)) IsProcessorFeaturePresent(DWORD);
WIN_BOOL __attribute__((__stdcall__)) IsValidLocale(DWORD,DWORD);
WIN_BOOL __attribute__((__stdcall__)) LookupAccountSidA(LPCSTR,PSID,LPSTR,LPDWORD,LPSTR,LPDWORD,PSID_NAME_USE);
WIN_BOOL __attribute__((__stdcall__)) LookupAccountSidW(LPCWSTR,PSID,LPWSTR,LPDWORD,LPWSTR,LPDWORD,PSID_NAME_USE);

WIN_BOOL __attribute__((__stdcall__)) LocalFileTimeToFileTime(const FILETIME*,LPFILETIME);
WIN_BOOL __attribute__((__stdcall__)) LockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
WIN_BOOL __attribute__((__stdcall__)) LockFileEx(HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED);
WIN_BOOL __attribute__((__stdcall__)) LookupPrivilegeValueA(LPCSTR,LPCSTR,LPVOID);
WIN_BOOL __attribute__((__stdcall__)) LookupPrivilegeValueW(LPCWSTR,LPCWSTR,LPVOID);

WIN_BOOL __attribute__((__stdcall__)) MakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
HMODULE __attribute__((__stdcall__)) MapHModuleSL(HMODULE16);
HMODULE16 __attribute__((__stdcall__)) MapHModuleLS(HMODULE);
SEGPTR __attribute__((__stdcall__)) MapLS(LPVOID);
LPVOID __attribute__((__stdcall__)) MapSL(SEGPTR);
LPVOID __attribute__((__stdcall__)) MapViewOfFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
LPVOID __attribute__((__stdcall__)) MapViewOfFileEx(HANDLE,DWORD,DWORD,DWORD,DWORD,LPVOID);
WIN_BOOL __attribute__((__stdcall__)) MoveFileA(LPCSTR,LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) MoveFileW(LPCWSTR,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) MoveFileExA(LPCSTR,LPCSTR,DWORD);
WIN_BOOL __attribute__((__stdcall__)) MoveFileExW(LPCWSTR,LPCWSTR,DWORD);

INT __attribute__((__stdcall__)) MultiByteToWideChar(UINT,DWORD,LPCSTR,INT,LPWSTR,INT);
WIN_BOOL __attribute__((__stdcall__)) NotifyChangeEventLog(HANDLE,HANDLE);
INT __attribute__((__stdcall__)) WideCharToMultiByte(UINT,DWORD,LPCWSTR,INT,LPSTR,INT,LPCSTR,WIN_BOOL*);
HANDLE __attribute__((__stdcall__)) OpenBackupEventLogA(LPCSTR,LPCSTR);
HANDLE __attribute__((__stdcall__)) OpenBackupEventLogW(LPCWSTR,LPCWSTR);

HANDLE __attribute__((__stdcall__)) OpenEventA(DWORD,WIN_BOOL,LPCSTR);
HANDLE __attribute__((__stdcall__)) OpenEventW(DWORD,WIN_BOOL,LPCWSTR);

HANDLE __attribute__((__stdcall__)) OpenEventLogA(LPCSTR,LPCSTR);
HANDLE __attribute__((__stdcall__)) OpenEventLogW(LPCWSTR,LPCWSTR);

HANDLE __attribute__((__stdcall__)) OpenFileMappingA(DWORD,WIN_BOOL,LPCSTR);
HANDLE __attribute__((__stdcall__)) OpenFileMappingW(DWORD,WIN_BOOL,LPCWSTR);

HANDLE __attribute__((__stdcall__)) OpenMutexA(DWORD,WIN_BOOL,LPCSTR);
HANDLE __attribute__((__stdcall__)) OpenMutexW(DWORD,WIN_BOOL,LPCWSTR);

HANDLE __attribute__((__stdcall__)) OpenProcess(DWORD,WIN_BOOL,DWORD);
WIN_BOOL __attribute__((__stdcall__)) OpenProcessToken(HANDLE,DWORD,PHANDLE);
HANDLE __attribute__((__stdcall__)) OpenSemaphoreA(DWORD,WIN_BOOL,LPCSTR);
HANDLE __attribute__((__stdcall__)) OpenSemaphoreW(DWORD,WIN_BOOL,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) OpenThreadToken(HANDLE,DWORD,WIN_BOOL,PHANDLE);
HANDLE __attribute__((__stdcall__)) OpenWaitableTimerA(DWORD,WIN_BOOL,LPCSTR);
HANDLE __attribute__((__stdcall__)) OpenWaitableTimerW(DWORD,WIN_BOOL,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) PulseEvent(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) PurgeComm(HANDLE,DWORD);
DWORD __attribute__((__stdcall__)) QueryDosDeviceA(LPCSTR,LPSTR,DWORD);
DWORD __attribute__((__stdcall__)) QueryDosDeviceW(LPCWSTR,LPWSTR,DWORD);

WIN_BOOL __attribute__((__stdcall__)) QueryPerformanceCounter(PLARGE_INTEGER);
WIN_BOOL __attribute__((__stdcall__)) ReadConsoleA(HANDLE,LPVOID,DWORD,LPDWORD,LPVOID);
WIN_BOOL __attribute__((__stdcall__)) ReadConsoleW(HANDLE,LPVOID,DWORD,LPDWORD,LPVOID);

WIN_BOOL __attribute__((__stdcall__)) ReadConsoleOutputCharacterA(HANDLE,LPSTR,DWORD,
                                                 COORD,LPDWORD);

WIN_BOOL __attribute__((__stdcall__)) ReadEventLogA(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *);
WIN_BOOL __attribute__((__stdcall__)) ReadEventLogW(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *);

WIN_BOOL __attribute__((__stdcall__)) ReadFile(HANDLE,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
HANDLE __attribute__((__stdcall__)) RegisterEventSourceA(LPCSTR,LPCSTR);
HANDLE __attribute__((__stdcall__)) RegisterEventSourceW(LPCWSTR,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) ReleaseMutex(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) ReleaseSemaphore(HANDLE,LONG,LPLONG);
WIN_BOOL __attribute__((__stdcall__)) ReportEventA(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCSTR *,LPVOID);
WIN_BOOL __attribute__((__stdcall__)) ReportEventW(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCWSTR *,LPVOID);

WIN_BOOL __attribute__((__stdcall__)) ResetEvent(HANDLE);
DWORD __attribute__((__stdcall__)) ResumeThread(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) RevertToSelf(void);
DWORD __attribute__((__stdcall__)) SearchPathA(LPCSTR,LPCSTR,LPCSTR,DWORD,LPSTR,LPSTR*);
DWORD __attribute__((__stdcall__)) SearchPathW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPWSTR*);

WIN_BOOL __attribute__((__stdcall__)) SetCommMask(INT,DWORD);
WIN_BOOL __attribute__((__stdcall__)) SetComputerNameA(LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) SetComputerNameW(LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) SetConsoleCursorPosition(HANDLE,COORD);
WIN_BOOL __attribute__((__stdcall__)) SetConsoleMode(HANDLE,DWORD);
WIN_BOOL __attribute__((__stdcall__)) SetConsoleTitleA(LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) SetConsoleTitleW(LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) SetEndOfFile(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) SetEnvironmentVariableA(LPCSTR,LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) SetEnvironmentVariableW(LPCWSTR,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) SetEvent(HANDLE);
VOID __attribute__((__stdcall__)) SetFileApisToANSI(void);
VOID __attribute__((__stdcall__)) SetFileApisToOEM(void);
DWORD __attribute__((__stdcall__)) SetFilePointer(HANDLE,LONG,LPLONG,DWORD);
WIN_BOOL __attribute__((__stdcall__)) SetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
WIN_BOOL __attribute__((__stdcall__)) SetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);

WIN_BOOL __attribute__((__stdcall__)) SetFileTime(HANDLE,const FILETIME*,const FILETIME*,const FILETIME*);
WIN_BOOL __attribute__((__stdcall__)) SetHandleInformation(HANDLE,DWORD,DWORD);
WIN_BOOL __attribute__((__stdcall__)) SetPriorityClass(HANDLE,DWORD);
WIN_BOOL __attribute__((__stdcall__)) SetLocalTime(const SYSTEMTIME*);
WIN_BOOL __attribute__((__stdcall__)) SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,WIN_BOOL,PACL,WIN_BOOL);
WIN_BOOL __attribute__((__stdcall__)) SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID,WIN_BOOL);
WIN_BOOL __attribute__((__stdcall__)) SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID,WIN_BOOL);
WIN_BOOL __attribute__((__stdcall__)) SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,WIN_BOOL,PACL,WIN_BOOL);
WIN_BOOL __attribute__((__stdcall__)) SetStdHandle(DWORD,HANDLE);
WIN_BOOL __attribute__((__stdcall__)) SetSystemPowerState(WIN_BOOL,WIN_BOOL);
WIN_BOOL __attribute__((__stdcall__)) SetSystemTime(const SYSTEMTIME*);
DWORD __attribute__((__stdcall__)) SetThreadAffinityMask(HANDLE,DWORD);
WIN_BOOL __attribute__((__stdcall__)) SetThreadContext(HANDLE,const CONTEXT *);
WIN_BOOL __attribute__((__stdcall__)) SetThreadLocale(LCID);
WIN_BOOL __attribute__((__stdcall__)) SetThreadPriority(HANDLE,INT);
WIN_BOOL __attribute__((__stdcall__)) SetTimeZoneInformation(const LPTIME_ZONE_INFORMATION);
WIN_BOOL __attribute__((__stdcall__)) SetWaitableTimer(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,LPVOID,WIN_BOOL);
VOID __attribute__((__stdcall__)) Sleep(DWORD);
DWORD __attribute__((__stdcall__)) SleepEx(DWORD,WIN_BOOL);
DWORD __attribute__((__stdcall__)) SuspendThread(HANDLE);
WIN_BOOL __attribute__((__stdcall__)) SystemTimeToFileTime(const SYSTEMTIME*,LPFILETIME);
DWORD __attribute__((__stdcall__)) TlsAlloc(void);
WIN_BOOL __attribute__((__stdcall__)) TlsFree(DWORD);
LPVOID __attribute__((__stdcall__)) TlsGetValue(DWORD);
WIN_BOOL __attribute__((__stdcall__)) TlsSetValue(DWORD,LPVOID);
VOID __attribute__((__stdcall__)) UnMapLS(SEGPTR);
WIN_BOOL __attribute__((__stdcall__)) UnlockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
WIN_BOOL __attribute__((__stdcall__)) UnmapViewOfFile(LPVOID);
LPVOID __attribute__((__stdcall__)) VirtualAlloc(LPVOID,DWORD,DWORD,DWORD);
WIN_BOOL __attribute__((__stdcall__)) VirtualFree(LPVOID,DWORD,DWORD);
WIN_BOOL __attribute__((__stdcall__)) VirtualLock(LPVOID,DWORD);
WIN_BOOL __attribute__((__stdcall__)) VirtualProtect(LPVOID,DWORD,DWORD,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) VirtualProtectEx(HANDLE,LPVOID,DWORD,DWORD,LPDWORD);
DWORD __attribute__((__stdcall__)) VirtualQuery(LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
DWORD __attribute__((__stdcall__)) VirtualQueryEx(HANDLE,LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
WIN_BOOL __attribute__((__stdcall__)) VirtualUnlock(LPVOID,DWORD);
WIN_BOOL __attribute__((__stdcall__)) WaitCommEvent(HANDLE,LPDWORD,LPOVERLAPPED);
WIN_BOOL __attribute__((__stdcall__)) WaitForDebugEvent(LPDEBUG_EVENT,DWORD);
DWORD __attribute__((__stdcall__)) WaitForMultipleObjects(DWORD,const HANDLE*,WIN_BOOL,DWORD);
DWORD __attribute__((__stdcall__)) WaitForMultipleObjectsEx(DWORD,const HANDLE*,WIN_BOOL,DWORD,WIN_BOOL);
DWORD __attribute__((__stdcall__)) WaitForSingleObject(HANDLE,DWORD);
DWORD __attribute__((__stdcall__)) WaitForSingleObjectEx(HANDLE,DWORD,WIN_BOOL);
WIN_BOOL __attribute__((__stdcall__)) WriteConsoleA(HANDLE,LPCVOID,DWORD,LPDWORD,LPVOID);
WIN_BOOL __attribute__((__stdcall__)) WriteConsoleW(HANDLE,LPCVOID,DWORD,LPDWORD,LPVOID);

WIN_BOOL __attribute__((__stdcall__)) WriteFile(HANDLE,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED);
LANGID __attribute__((__stdcall__)) GetSystemDefaultLangID(void);
LCID __attribute__((__stdcall__)) GetSystemDefaultLCID(void);
LANGID __attribute__((__stdcall__)) GetUserDefaultLangID(void);
LCID __attribute__((__stdcall__)) GetUserDefaultLCID(void);
ATOM __attribute__((__stdcall__)) AddAtomA(LPCSTR);
ATOM __attribute__((__stdcall__)) AddAtomW(LPCWSTR);

UINT __attribute__((__stdcall__)) CompareStringA(DWORD,DWORD,LPCSTR,DWORD,LPCSTR,DWORD);
UINT __attribute__((__stdcall__)) CompareStringW(DWORD,DWORD,LPCWSTR,DWORD,LPCWSTR,DWORD);

WIN_BOOL __attribute__((__stdcall__)) CreateDirectoryA(LPCSTR,LPSECURITY_ATTRIBUTES);
WIN_BOOL __attribute__((__stdcall__)) CreateDirectoryW(LPCWSTR,LPSECURITY_ATTRIBUTES);

WIN_BOOL __attribute__((__stdcall__)) CreateDirectoryExA(LPCSTR,LPCSTR,LPSECURITY_ATTRIBUTES);
WIN_BOOL __attribute__((__stdcall__)) CreateDirectoryExW(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES);

WIN_BOOL __attribute__((__stdcall__)) DefineDosDeviceA(DWORD,LPCSTR,LPCSTR);

ATOM __attribute__((__stdcall__)) DeleteAtom(ATOM);
WIN_BOOL __attribute__((__stdcall__)) DeleteFileA(LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) DeleteFileW(LPCWSTR);

void __attribute__((__stdcall__)) FatalAppExitA(UINT,LPCSTR);
void __attribute__((__stdcall__)) FatalAppExitW(UINT,LPCWSTR);

ATOM __attribute__((__stdcall__)) FindAtomA(LPCSTR);
ATOM __attribute__((__stdcall__)) FindAtomW(LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) FindClose(HANDLE);
HANDLE16 __attribute__((__stdcall__)) FindFirstFile16(LPCSTR,LPWIN32_FIND_DATAA);
HANDLE __attribute__((__stdcall__)) FindFirstFileA(LPCSTR,LPWIN32_FIND_DATAA);
HANDLE __attribute__((__stdcall__)) FindFirstFileW(LPCWSTR,LPWIN32_FIND_DATAW);

WIN_BOOL16 __attribute__((__stdcall__)) FindNextFile16(HANDLE16,LPWIN32_FIND_DATAA);
WIN_BOOL __attribute__((__stdcall__)) FindNextFileA(HANDLE,LPWIN32_FIND_DATAA);
WIN_BOOL __attribute__((__stdcall__)) FindNextFileW(HANDLE,LPWIN32_FIND_DATAW);

HRSRC __attribute__((__stdcall__)) FindResourceA(HMODULE,LPCSTR,LPCSTR);
HRSRC __attribute__((__stdcall__)) FindResourceW(HMODULE,LPCWSTR,LPCWSTR);

VOID __attribute__((__stdcall__)) FreeLibrary16(HINSTANCE16);
WIN_BOOL __attribute__((__stdcall__)) FreeLibrary(HMODULE);


WIN_BOOL __attribute__((__stdcall__)) FreeResource(HGLOBAL);
UINT __attribute__((__stdcall__)) GetAtomNameA(ATOM,LPSTR,INT);
UINT __attribute__((__stdcall__)) GetAtomNameW(ATOM,LPWSTR,INT);

UINT __attribute__((__stdcall__)) GetCurrentDirectoryA(UINT,LPSTR);
UINT __attribute__((__stdcall__)) GetCurrentDirectoryW(UINT,LPWSTR);

WIN_BOOL __attribute__((__stdcall__)) GetDiskFreeSpaceA(LPCSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetDiskFreeSpaceW(LPCWSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD);

WIN_BOOL __attribute__((__stdcall__)) GetDiskFreeSpaceExA(LPCSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
WIN_BOOL __attribute__((__stdcall__)) GetDiskFreeSpaceExW(LPCWSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);

UINT __attribute__((__stdcall__)) GetDriveTypeA(LPCSTR);
UINT __attribute__((__stdcall__)) GetDriveTypeW(LPCWSTR);

DWORD __attribute__((__stdcall__)) GetFileAttributesA(LPCSTR);
DWORD __attribute__((__stdcall__)) GetFileAttributesW(LPCWSTR);


UINT __attribute__((__stdcall__)) GetLogicalDriveStringsA(UINT,LPSTR);
UINT __attribute__((__stdcall__)) GetLogicalDriveStringsW(UINT,LPWSTR);

INT __attribute__((__stdcall__)) GetLocaleInfoA(LCID,LCTYPE,LPSTR,INT);
INT __attribute__((__stdcall__)) GetLocaleInfoW(LCID,LCTYPE,LPWSTR,INT);

DWORD __attribute__((__stdcall__)) GetModuleFileNameA(HMODULE,LPSTR,DWORD);
DWORD __attribute__((__stdcall__)) GetModuleFileNameW(HMODULE,LPWSTR,DWORD);

HMODULE __attribute__((__stdcall__)) GetModuleHandleA(LPCSTR);
HMODULE __attribute__((__stdcall__)) GetModuleHandleW(LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) GetOverlappedResult(HANDLE,LPOVERLAPPED,LPDWORD,WIN_BOOL);
UINT __attribute__((__stdcall__)) GetPrivateProfileIntA(LPCSTR,LPCSTR,INT,LPCSTR);
UINT __attribute__((__stdcall__)) GetPrivateProfileIntW(LPCWSTR,LPCWSTR,INT,LPCWSTR);

INT __attribute__((__stdcall__)) GetPrivateProfileSectionA(LPCSTR,LPSTR,DWORD,LPCSTR);
INT __attribute__((__stdcall__)) GetPrivateProfileSectionW(LPCWSTR,LPWSTR,DWORD,LPCWSTR);

DWORD __attribute__((__stdcall__)) GetPrivateProfileSectionNamesA(LPSTR,DWORD,LPCSTR);
DWORD __attribute__((__stdcall__)) GetPrivateProfileSectionNamesW(LPWSTR,DWORD,LPCWSTR);

INT __attribute__((__stdcall__)) GetPrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT,LPCSTR);
INT __attribute__((__stdcall__)) GetPrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) GetPrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) GetPrivateProfileStructW(LPCWSTR,LPCWSTR,LPVOID,UINT,LPCWSTR);

FARPROC __attribute__((__stdcall__)) GetProcAddress(HMODULE,LPCSTR);
UINT __attribute__((__stdcall__)) GetProfileIntA(LPCSTR,LPCSTR,INT);
UINT __attribute__((__stdcall__)) GetProfileIntW(LPCWSTR,LPCWSTR,INT);

INT __attribute__((__stdcall__)) GetProfileSectionA(LPCSTR,LPSTR,DWORD);
INT __attribute__((__stdcall__)) GetProfileSectionW(LPCWSTR,LPWSTR,DWORD);

INT __attribute__((__stdcall__)) GetProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT);
INT __attribute__((__stdcall__)) GetProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT);

VOID __attribute__((__stdcall__)) GetStartupInfoA(LPSTARTUPINFOA);
VOID __attribute__((__stdcall__)) GetStartupInfoW(LPSTARTUPINFOW);

WIN_BOOL __attribute__((__stdcall__)) GetStringTypeA(LCID,DWORD,LPCSTR,INT,LPWORD);
WIN_BOOL __attribute__((__stdcall__)) GetStringTypeW(DWORD,LPCWSTR,INT,LPWORD);

UINT __attribute__((__stdcall__)) GetSystemDirectoryA(LPSTR,UINT);
UINT __attribute__((__stdcall__)) GetSystemDirectoryW(LPWSTR,UINT);

UINT __attribute__((__stdcall__)) GetTempFileNameA(LPCSTR,LPCSTR,UINT,LPSTR);
UINT __attribute__((__stdcall__)) GetTempFileNameW(LPCWSTR,LPCWSTR,UINT,LPWSTR);

UINT __attribute__((__stdcall__)) GetTempPathA(UINT,LPSTR);
UINT __attribute__((__stdcall__)) GetTempPathW(UINT,LPWSTR);

LONG __attribute__((__stdcall__)) GetVersion(void);
WIN_BOOL __attribute__((__stdcall__)) GetExitCodeProcess(HANDLE,LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) GetVolumeInformationA(LPCSTR,LPSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPSTR,DWORD);
WIN_BOOL __attribute__((__stdcall__)) GetVolumeInformationW(LPCWSTR,LPWSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPWSTR,DWORD);

UINT __attribute__((__stdcall__)) GetWindowsDirectoryA(LPSTR,UINT);
UINT __attribute__((__stdcall__)) GetWindowsDirectoryW(LPWSTR,UINT);

HGLOBAL16 __attribute__((__stdcall__)) GlobalAlloc16(UINT16,DWORD);
HGLOBAL __attribute__((__stdcall__)) GlobalAlloc(UINT,DWORD);
DWORD __attribute__((__stdcall__)) GlobalCompact(DWORD);
UINT __attribute__((__stdcall__)) GlobalFlags(HGLOBAL);
HGLOBAL16 __attribute__((__stdcall__)) GlobalFree16(HGLOBAL16);
HGLOBAL __attribute__((__stdcall__)) GlobalFree(HGLOBAL);
HGLOBAL __attribute__((__stdcall__)) GlobalHandle(LPCVOID);
WORD __attribute__((__stdcall__)) GlobalFix16(HGLOBAL16);
VOID __attribute__((__stdcall__)) GlobalFix(HGLOBAL);
LPVOID __attribute__((__stdcall__)) GlobalLock16(HGLOBAL16);
LPVOID __attribute__((__stdcall__)) GlobalLock(HGLOBAL);
HGLOBAL __attribute__((__stdcall__)) GlobalReAlloc(HGLOBAL,DWORD,UINT);
DWORD __attribute__((__stdcall__)) GlobalSize16(HGLOBAL16);
DWORD __attribute__((__stdcall__)) GlobalSize(HGLOBAL);
VOID __attribute__((__stdcall__)) GlobalUnfix16(HGLOBAL16);
VOID __attribute__((__stdcall__)) GlobalUnfix(HGLOBAL);
WIN_BOOL16 __attribute__((__stdcall__)) GlobalUnlock16(HGLOBAL16);
WIN_BOOL __attribute__((__stdcall__)) GlobalUnlock(HGLOBAL);
WIN_BOOL16 __attribute__((__stdcall__)) GlobalUnWire16(HGLOBAL16);
WIN_BOOL __attribute__((__stdcall__)) GlobalUnWire(HGLOBAL);
SEGPTR __attribute__((__stdcall__)) GlobalWire16(HGLOBAL16);
LPVOID __attribute__((__stdcall__)) GlobalWire(HGLOBAL);
WIN_BOOL __attribute__((__stdcall__)) InitAtomTable(DWORD);
WIN_BOOL __attribute__((__stdcall__)) IsBadCodePtr(FARPROC);
WIN_BOOL __attribute__((__stdcall__)) IsBadHugeReadPtr(LPCVOID,UINT);
WIN_BOOL __attribute__((__stdcall__)) IsBadHugeWritePtr(LPVOID,UINT);
WIN_BOOL __attribute__((__stdcall__)) IsBadReadPtr(LPCVOID,UINT);
WIN_BOOL __attribute__((__stdcall__)) IsBadStringPtrA(LPCSTR,UINT);
WIN_BOOL __attribute__((__stdcall__)) IsBadStringPtrW(LPCWSTR,UINT);

WIN_BOOL __attribute__((__stdcall__)) IsBadWritePtr(LPVOID,UINT);
WIN_BOOL __attribute__((__stdcall__)) IsDBCSLeadByte(BYTE);
WIN_BOOL __attribute__((__stdcall__)) IsDebuggerPresent(void);
HINSTANCE16 __attribute__((__stdcall__)) LoadLibrary16(LPCSTR);
HMODULE __attribute__((__stdcall__)) LoadLibraryA(LPCSTR);
HMODULE __attribute__((__stdcall__)) LoadLibraryW(LPCWSTR);

HMODULE __attribute__((__stdcall__)) LoadLibraryExA(LPCSTR,HANDLE,DWORD);
HMODULE __attribute__((__stdcall__)) LoadLibraryExW(LPCWSTR,HANDLE,DWORD);

HINSTANCE16 __attribute__((__stdcall__)) LoadModule16(LPCSTR,LPVOID);
HINSTANCE __attribute__((__stdcall__)) LoadModule(LPCSTR,LPVOID);
HGLOBAL __attribute__((__stdcall__)) LoadResource(HMODULE,HRSRC);
HLOCAL __attribute__((__stdcall__)) LocalAlloc(UINT,DWORD);
UINT __attribute__((__stdcall__)) LocalCompact(UINT);
UINT __attribute__((__stdcall__)) LocalFlags(HLOCAL);
HLOCAL __attribute__((__stdcall__)) LocalFree(HLOCAL);
HLOCAL __attribute__((__stdcall__)) LocalHandle(LPCVOID);
LPVOID __attribute__((__stdcall__)) LocalLock(HLOCAL);
HLOCAL __attribute__((__stdcall__)) LocalReAlloc(HLOCAL,DWORD,UINT);
UINT __attribute__((__stdcall__)) LocalShrink(HGLOBAL,UINT);
UINT __attribute__((__stdcall__)) LocalSize(HLOCAL);
WIN_BOOL __attribute__((__stdcall__)) LocalUnlock(HLOCAL);
LPVOID __attribute__((__stdcall__)) LockResource(HGLOBAL);


HFILE16 __attribute__((__stdcall__)) OpenFile16(LPCSTR,OFSTRUCT*,UINT16);
HFILE __attribute__((__stdcall__)) OpenFile(LPCSTR,OFSTRUCT*,UINT);
VOID __attribute__((__stdcall__)) OutputDebugStringA(LPCSTR);
VOID __attribute__((__stdcall__)) OutputDebugStringW(LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) ReadProcessMemory(HANDLE, LPCVOID, LPVOID, DWORD, LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) RemoveDirectoryA(LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) RemoveDirectoryW(LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) SetCurrentDirectoryA(LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) SetCurrentDirectoryW(LPCWSTR);

UINT __attribute__((__stdcall__)) SetErrorMode(UINT);
WIN_BOOL __attribute__((__stdcall__)) SetFileAttributesA(LPCSTR,DWORD);
WIN_BOOL __attribute__((__stdcall__)) SetFileAttributesW(LPCWSTR,DWORD);

UINT __attribute__((__stdcall__)) SetHandleCount(UINT);

WIN_BOOL __attribute__((__stdcall__)) SetVolumeLabelA(LPCSTR,LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) SetVolumeLabelW(LPCWSTR,LPCWSTR);

DWORD __attribute__((__stdcall__)) SizeofResource(HMODULE,HRSRC);

WIN_BOOL __attribute__((__stdcall__)) WritePrivateProfileSectionA(LPCSTR,LPCSTR,LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) WritePrivateProfileSectionW(LPCWSTR,LPCWSTR,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) WritePrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) WritePrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) WriteProfileSectionA(LPCSTR,LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) WriteProfileSectionW(LPCWSTR,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) WritePrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) WritePrivateProfileStructW(LPCWSTR,LPCWSTR,LPVOID,UINT,LPCWSTR);

WIN_BOOL __attribute__((__stdcall__)) WriteProcessMemory(HANDLE, LPVOID, LPVOID, DWORD, LPDWORD);
WIN_BOOL __attribute__((__stdcall__)) WriteProfileStringA(LPCSTR,LPCSTR,LPCSTR);
WIN_BOOL __attribute__((__stdcall__)) WriteProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR);


LPSTR __attribute__((__stdcall__)) lstrcatA(LPSTR,LPCSTR);
LPWSTR __attribute__((__stdcall__)) lstrcatW(LPWSTR,LPCWSTR);

LPSTR __attribute__((__stdcall__)) lstrcpyA(LPSTR,LPCSTR);
LPWSTR __attribute__((__stdcall__)) lstrcpyW(LPWSTR,LPCWSTR);

LPSTR __attribute__((__stdcall__)) lstrcpynA(LPSTR,LPCSTR,INT);
LPWSTR __attribute__((__stdcall__)) lstrcpynW(LPWSTR,LPCWSTR,INT);

INT __attribute__((__stdcall__)) lstrlenA(LPCSTR);
INT __attribute__((__stdcall__)) lstrlenW(LPCWSTR);

HINSTANCE __attribute__((__stdcall__)) WinExec(LPCSTR,UINT);
LONG __attribute__((__stdcall__)) _hread(HFILE,LPVOID,LONG);
LONG __attribute__((__stdcall__)) _hwrite(HFILE,LPCSTR,LONG);
HFILE __attribute__((__stdcall__)) _lcreat(LPCSTR,INT);
HFILE __attribute__((__stdcall__)) _lclose(HFILE);
LONG __attribute__((__stdcall__)) _llseek(HFILE,LONG,INT);
HFILE __attribute__((__stdcall__)) _lopen(LPCSTR,INT);
UINT __attribute__((__stdcall__)) _lread(HFILE,LPVOID,UINT);
UINT __attribute__((__stdcall__)) _lwrite(HFILE,LPCSTR,UINT);
SEGPTR __attribute__((__stdcall__)) WIN16_GlobalLock16(HGLOBAL16);
INT __attribute__((__stdcall__)) lstrcmpA(LPCSTR,LPCSTR);
INT __attribute__((__stdcall__)) lstrcmpW(LPCWSTR,LPCWSTR);

INT __attribute__((__stdcall__)) lstrcmpiA(LPCSTR,LPCSTR);
INT __attribute__((__stdcall__)) lstrcmpiW(LPCWSTR,LPCWSTR);
DWORD __attribute__((__stdcall__)) GetCurrentProcessId(void);
DWORD __attribute__((__stdcall__)) GetCurrentThreadId(void);
DWORD __attribute__((__stdcall__)) GetLastError(void);
HANDLE __attribute__((__stdcall__)) GetProcessHeap(void);
PVOID __attribute__((__stdcall__)) InterlockedCompareExchange(PVOID*,PVOID,PVOID);
LONG __attribute__((__stdcall__)) InterlockedDecrement(PLONG);
LONG __attribute__((__stdcall__)) InterlockedExchange(PLONG,LONG);
LONG __attribute__((__stdcall__)) InterlockedExchangeAdd(PLONG,LONG);
LONG __attribute__((__stdcall__)) InterlockedIncrement(PLONG);
VOID __attribute__((__stdcall__)) SetLastError(DWORD);
void* CoTaskMemAlloc(unsigned long cb);
void CoTaskMemFree(void* cb);

typedef struct
{
    long f1;
    short f2;
    short f3;
    char f4[8];
} GUID;

extern GUID IID_IUnknown;
extern GUID IID_IClassFactory;

typedef long (*GETCLASSOBJECT) (GUID* clsid, GUID* iid, void** ppv);
int RegisterComClass(GUID* clsid, GETCLASSOBJECT gcs);





struct IUnknown;
struct IClassFactory;
struct IUnknown_vt
{
    long __attribute__((__stdcall__)) (*QueryInterface)(struct IUnknown* _this, GUID* iid, void** ppv);
    long __attribute__((__stdcall__)) (*AddRef)(struct IUnknown* _this) ;
    long __attribute__((__stdcall__)) (*Release)(struct IUnknown* _this) ;
} ;
struct IUnknown
{
    struct IUnknown_vt* vt;
};

struct IClassFactory_vt
{
    long __attribute__((__stdcall__)) (*QueryInterface)(struct IUnknown* _this, GUID* iid, void** ppv);
    long __attribute__((__stdcall__)) (*AddRef)(struct IUnknown* _this) ;
    long __attribute__((__stdcall__)) (*Release)(struct IUnknown* _this) ;
    long __attribute__((__stdcall__)) (*CreateInstance)(struct IClassFactory* _this, struct IUnknown* pUnkOuter, GUID* riid, void** ppvObject);
};

struct IClassFactory
{
    struct IClassFactory_vt* vt;
};

long CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
                    long dwClsContext, GUID* riid, void** ppv);

extern void* my_mreq(int size, int to_zero);
extern int my_release(void* memory);
extern int my_size(char* memory);
extern int my_garbagecollection(void);


typedef struct {
    UINT uDriverSignature;
    HINSTANCE hDriverModule;
    DRIVERPROC DriverProc;
    DWORD dwDriverID;
} DRVR;

typedef DRVR *PDRVR;
typedef DRVR *NPDRVR;
typedef DRVR *LPDRVR;

typedef struct tls_s tls_t;

extern int __attribute__((__stdcall__)) ext_unknown(void);

extern int __attribute__((__stdcall__)) expIsBadWritePtr(void* ptr, unsigned int count);
extern int __attribute__((__stdcall__)) expIsBadReadPtr(void* ptr, unsigned int count);
extern int __attribute__((__stdcall__)) expDisableThreadLibraryCalls(int module);
extern void* __attribute__((__stdcall__)) expGetDriverModuleHandle(DRVR* pdrv);
extern void* __attribute__((__stdcall__)) expGetModuleHandleA(const char* name);
extern void* __attribute__((__stdcall__)) expCreateThread(void* pSecAttr, long dwStackSize, void* lpStartAddress,
                                    void* lpParameter, long dwFlags, long* dwThreadId);
extern void* __attribute__((__stdcall__)) expCreateEventA(void* pSecAttr, char bManualReset,
                                    char bInitialState, const char* name);
extern void* __attribute__((__stdcall__)) expSetEvent(void* event);
extern void* __attribute__((__stdcall__)) expResetEvent(void* event);
extern void* __attribute__((__stdcall__)) expWaitForSingleObject(void* object, int duration);
extern WIN_BOOL __attribute__((__stdcall__)) expIsProcessorFeaturePresent(DWORD v);
extern void __attribute__((__stdcall__)) expGetSystemInfo(SYSTEM_INFO* si);
extern long __attribute__((__stdcall__)) expGetVersion(void);
long __attribute__((__stdcall__)) expGetVersionExA(OSVERSIONINFOA* c);
extern HANDLE __attribute__((__stdcall__)) expHeapCreate(long flags, long init_size, long max_size);
extern void* __attribute__((__stdcall__)) expHeapAlloc(HANDLE heap, int flags, int size);
extern long __attribute__((__stdcall__)) expHeapDestroy(void* heap);
extern long __attribute__((__stdcall__)) expHeapFree(int arg1, int arg2, void* ptr);
extern long __attribute__((__stdcall__)) expHeapSize(int heap, int flags, void* pointer);
extern long __attribute__((__stdcall__)) expGetProcessHeap(void);
extern void* __attribute__((__stdcall__)) expVirtualAlloc(void* v1, long v2, long v3, long v4);
extern int __attribute__((__stdcall__)) expVirtualFree(void* v1, int v2, int v3);
extern void __attribute__((__stdcall__)) expInitializeCriticalSection(CRITICAL_SECTION* c);
extern void __attribute__((__stdcall__)) expEnterCriticalSection(CRITICAL_SECTION* c);
extern void __attribute__((__stdcall__)) expLeaveCriticalSection(CRITICAL_SECTION* c);
extern void __attribute__((__stdcall__)) expDeleteCriticalSection(CRITICAL_SECTION *c);
extern int __attribute__((__stdcall__)) expGetCurrentThreadId(void);
extern int __attribute__((__stdcall__)) expGetCurrentProcess(void);
extern void* __attribute__((__stdcall__)) expTlsAlloc(void);
extern int __attribute__((__stdcall__)) expTlsSetValue(tls_t* index, void* value);
extern void* __attribute__((__stdcall__)) expTlsGetValue(tls_t* index);
extern int __attribute__((__stdcall__)) expTlsFree(tls_t* index);
extern void* __attribute__((__stdcall__)) expLocalAlloc(int flags, int size);
extern void* __attribute__((__stdcall__)) expLocalLock(void* z);
extern void* __attribute__((__stdcall__)) expGlobalAlloc(int flags, int size);
extern void* __attribute__((__stdcall__)) expGlobalLock(void* z);
extern int __attribute__((__stdcall__)) expLoadStringA(long instance, long id, void* buf, long size);
extern long __attribute__((__stdcall__)) expMultiByteToWideChar(long v1, long v2, char* s1, long siz1, short* s2, int siz2);
extern long __attribute__((__stdcall__)) expWideCharToMultiByte(long v1, long v2, short* s1, long siz1, char* s2, int siz2, char* c3, int* siz3);
extern long __attribute__((__stdcall__)) expGetVersionExA(OSVERSIONINFOA* c);
extern HANDLE __attribute__((__stdcall__)) expCreateSemaphoreA(char* v1, long init_count, long max_count, char* name);
extern long __attribute__((__stdcall__)) expReleaseSemaphore(long hsem, long increment, long* prev_count);
extern long __attribute__((__stdcall__)) expRegOpenKeyExA(long key, const char* subkey, long reserved, long access, int* newkey);
extern long __attribute__((__stdcall__)) expRegCloseKey(long key);

extern long __attribute__((__stdcall__)) expRegQueryValueExA(long key, const char* value, int* reserved, int* type, int* data, int* count);
extern long __attribute__((__stdcall__)) expRegCreateKeyExA(long key, const char* name, long reserved,
                                      void* classs, long options, long security,
                                      void* sec_attr, int* newkey, int* status);
extern long __attribute__((__stdcall__)) expRegSetValueExA(long key, const char* name, long v1, long v2, void* data, long size);
extern long __attribute__((__stdcall__)) expRegOpenKeyA (long hKey, LPCSTR lpSubKey, int* phkResult);
extern long __attribute__((__stdcall__)) expQueryPerformanceCounter(long long* z);
extern long __attribute__((__stdcall__)) expQueryPerformanceFrequency(long long* z);
extern long __attribute__((__stdcall__)) exptimeGetTime(void);
extern void* __attribute__((__stdcall__)) expLocalHandle(void* v);
extern void* __attribute__((__stdcall__)) expGlobalHandle(void* v);
extern int __attribute__((__stdcall__)) expGlobalUnlock(void* v);
extern void* __attribute__((__stdcall__)) expGlobalFree(void* v);
extern void* __attribute__((__stdcall__)) expGlobalReAlloc(void* v, int size, int flags);
extern int __attribute__((__stdcall__)) expLocalUnlock(void* v);
extern void* __attribute__((__stdcall__)) expLocalFree(void* v);
extern HRSRC __attribute__((__stdcall__)) expFindResourceA(HMODULE module, char* name, char* type);
extern HGLOBAL __attribute__((__stdcall__)) expLoadResource(HMODULE module, HRSRC res);
extern void* __attribute__((__stdcall__)) expLockResource(long res);
extern int __attribute__((__stdcall__)) expFreeResource(long res);
extern int __attribute__((__stdcall__)) expCloseHandle(long v1);
extern const char* __attribute__((__stdcall__)) expGetCommandLineA(void);
extern LPWSTR __attribute__((__stdcall__)) expGetEnvironmentStringsW(void);
extern void * __attribute__((__stdcall__)) expRtlZeroMemory(void *p, size_t len);
extern void * __attribute__((__stdcall__)) expRtlMoveMemory(void *dst, void *src, size_t len);
extern void * __attribute__((__stdcall__)) expRtlFillMemory(void *p, int ch, size_t len);
extern int __attribute__((__stdcall__)) expFreeEnvironmentStringsW(short* strings);
extern int __attribute__((__stdcall__)) expFreeEnvironmentStringsA(char* strings);
extern LPWSTR __attribute__((__stdcall__)) expGetEnvironmentStringsW(void);
LPCSTR __attribute__((__stdcall__)) expGetEnvironmentStrings(void);
extern int __attribute__((__stdcall__)) expGetStartupInfoA(STARTUPINFOA *s);
extern int __attribute__((__stdcall__)) expGetStdHandle(int z);
extern int __attribute__((__stdcall__)) expGetFileType(int handle);
extern int __attribute__((__stdcall__)) expSetHandleCount(int count);
extern int __attribute__((__stdcall__)) expGetACP(void);
extern int __attribute__((__stdcall__)) expGetModuleFileNameA(int module, char* s, int len);
extern int __attribute__((__stdcall__)) expSetUnhandledExceptionFilter(void* filter);
extern int __attribute__((__stdcall__)) expLoadLibraryA(char* name);
extern int __attribute__((__stdcall__)) expFreeLibrary(int module);
extern void* __attribute__((__stdcall__)) expGetProcAddress(HMODULE mod, char* name);
extern long __attribute__((__stdcall__)) expCreateFileMappingA(int hFile, void* lpAttr,
                                         long flProtect, long dwMaxHigh, long dwMaxLow, const char* name);
extern long __attribute__((__stdcall__)) expOpenFileMappingA(long hFile, long hz, const char* name);
extern void* __attribute__((__stdcall__)) expMapViewOfFile(HANDLE file, DWORD mode, DWORD offHigh, DWORD offLow, DWORD size);
extern void* __attribute__((__stdcall__)) expUnmapViewOfFile(void* view);
extern void* __attribute__((__stdcall__)) expSleep(int time);
extern void* __attribute__((__stdcall__)) expCreateCompatibleDC(int hdc);
extern int __attribute__((__stdcall__)) expGetDeviceCaps(int hdc, int unk);
extern WIN_BOOL __attribute__((__stdcall__)) expDeleteDC(int hdc);
extern int __attribute__((__stdcall__)) expGetPrivateProfileIntA(const char* appname, const char* keyname, int default_value, const char* filename);
extern int __attribute__((__stdcall__)) expGetProfileIntA(const char* appname, const char* keyname, int default_value);
extern int __attribute__((__stdcall__)) expGetPrivateProfileStringA(const char* appname, const char* keyname,
                                              const char* def_val, char* dest, unsigned int len, const char* filename);
extern int __attribute__((__stdcall__)) expWritePrivateProfileStringA(const char* appname, const char* keyname,
                                                const char* string, const char* filename);
extern int __attribute__((__stdcall__)) expDefDriverProc(int _private, int id, int msg, int arg1, int arg2);
extern int __attribute__((__stdcall__)) expSizeofResource(int v1, int v2);
extern int __attribute__((__stdcall__)) expGetLastError(void);
extern void __attribute__((__stdcall__)) expSetLastError(int error);
extern long __attribute__((__stdcall__)) exptimeGetTime(void);
extern int __attribute__((__stdcall__)) expStringFromGUID2(GUID* guid, char* str, int cbMax);
extern int __attribute__((__stdcall__)) expGetFileVersionInfoSizeA(const char* name, int* lpHandle);
extern int __attribute__((__stdcall__)) expIsBadStringPtrW(const short* string, int nchars);
extern int __attribute__((__stdcall__)) expIsBadStringPtrA(const char* string, int nchars);
extern long __attribute__((__stdcall__)) expInterlockedIncrement( long* dest );
extern long __attribute__((__stdcall__)) expInterlockedDecrement( long* dest );
extern void __attribute__((__stdcall__)) expOutputDebugStringA( const char* string );
extern int __attribute__((__stdcall__)) expGetDC(int hwnd);
extern int __attribute__((__stdcall__)) expGetDesktopWindow(void);
extern int __attribute__((__stdcall__)) expReleaseDC(int hwnd, int hdc);
extern int __attribute__((__stdcall__)) expLoadCursorA(int handle,LPCSTR name);
extern int __attribute__((__stdcall__)) expSetCursor(void *cursor);
extern int __attribute__((__stdcall__)) expGetSystemPaletteEntries(int hdc, int iStartIndex, int nEntries, void* lppe);
extern int __attribute__((__stdcall__)) expGetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation);
extern void __attribute__((__stdcall__)) expGetLocalTime(SYSTEMTIME* systime);
extern int __attribute__((__stdcall__)) expGetSystemTime(SYSTEMTIME* systime);
extern int __attribute__((__stdcall__)) expGetEnvironmentVariableA(const char* name, char* field, int size);
extern void* __attribute__((__stdcall__)) expCoTaskMemAlloc(ULONG cb);
extern void __attribute__((__stdcall__)) expCoTaskMemFree(void* cb);
extern long __attribute__((__stdcall__)) expCoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
                                       long dwClsContext, GUID* riid, void** ppv);
extern int __attribute__((__stdcall__)) expIsRectEmpty(const RECT *lprc);
extern unsigned int __attribute__((__stdcall__)) expGetTempPathA(unsigned int len, char* path);
extern HANDLE __attribute__((__stdcall__)) expFindFirstFileA(LPCSTR s, LPWIN32_FIND_DATAA lpfd);
extern WIN_BOOL __attribute__((__stdcall__)) expFindNextFileA(HANDLE h,LPWIN32_FIND_DATAA p);
extern WIN_BOOL __attribute__((__stdcall__)) expFindClose(HANDLE h);
extern UINT __attribute__((__stdcall__)) expSetErrorMode(UINT i);
extern UINT __attribute__((__stdcall__)) expGetWindowsDirectoryA(LPSTR s,UINT c);
extern WIN_BOOL __attribute__((__stdcall__)) expDeleteFileA(LPCSTR s);
extern WIN_BOOL __attribute__((__stdcall__)) expFileTimeToLocalFileTime(const FILETIME* cpf, LPFILETIME pf);
extern UINT __attribute__((__stdcall__)) expGetTempFileNameA(LPCSTR cs1,LPCSTR cs2,UINT i,LPSTR ps);
extern HANDLE __attribute__((__stdcall__)) expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2,
                                    LPSECURITY_ATTRIBUTES p1, DWORD i3,DWORD i4,HANDLE i5);
extern LPCSTR __attribute__((__stdcall__)) expGetSystemDirectoryA(void);
extern WIN_BOOL __attribute__((__stdcall__)) expReadFile(HANDLE h,LPVOID pv,DWORD size,LPDWORD rd,LPOVERLAPPED unused);
extern WIN_BOOL __attribute__((__stdcall__)) expWriteFile(HANDLE h,LPCVOID pv,DWORD size,LPDWORD wr,LPOVERLAPPED unused);
extern DWORD __attribute__((__stdcall__)) expSetFilePointer(HANDLE h, LONG val, LPLONG ext, DWORD whence);
extern HDRVR __attribute__((__stdcall__)) expOpenDriverA(LPCSTR szDriverName, LPCSTR szSectionName,
                                   LPARAM lParam2);
HDRVR __attribute__((__stdcall__)) expOpenDriver(LPCSTR szDriverName, LPCSTR szSectionName,
                           LPARAM lParam2) ;
extern WIN_BOOL __attribute__((__stdcall__)) expGetProcessAffinityMask(HANDLE hProcess,
                                                 LPDWORD lpProcessAffinityMask,
                                                 LPDWORD lpSystemAffinityMask);
extern DWORD __attribute__((__stdcall__)) expRegEnumValueA( HKEY hkey, DWORD index, LPSTR value, LPDWORD val_count,
                                       LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count );
extern INT __attribute__((__stdcall__)) expMulDiv(int nNumber,int nNumerator,int nDenominator);
extern LONG __attribute__((__stdcall__)) explstrcmpiA(const char* str1, const char* str2);
extern LONG __attribute__((__stdcall__)) explstrlenA(const char* str1);
extern LONG __attribute__((__stdcall__)) explstrcpyA(char* str1, const char* str2);
extern LONG __attribute__((__stdcall__)) expInterlockedExchange(long *dest, long l);

extern void* __attribute__((__cdecl__)) expmalloc(int size);
extern void __attribute__((__cdecl__)) expfree(void* mem);
extern void* __attribute__((__cdecl__)) expnew(int size);
extern int __attribute__((__cdecl__)) expdelete(void* memory);
extern int __attribute__((__cdecl__)) exp_initterm(int v1, int v2);

extern int expwsprintfA(char* string, char* format, ...);
extern char* expstrrchr(char* string, int value);
extern char* expstrchr(char* string, int value);
extern int expstrlen(char* str);
extern int expstrcpy(char* str1, const char* str2);
extern int expstrcmp(const char* str1, const char* str2);
extern int expstrcat(char* str1, const char* str2);
extern int expisalnum(int c);
extern int expmemmove(void* dest, void* src, int n);
extern int expmemcmp(void* dest, void* src, int n);
extern void *expmemcpy(void* dest, void* src, int n) ;
extern time_t exptime(time_t* t);
extern void* LookupExternal(const char* library, int ordinal);





typedef __gnuc_va_list va_list;






typedef struct tagHIGHCONTRASTA
{
    UINT cbSize;
    DWORD dwFlags;
    LPSTR lpszDefaultScheme;
} HIGHCONTRASTA, *LPHIGHCONTRASTA;

typedef struct tagHIGHCONTRASTW
{
    UINT cbSize;
    DWORD dwFlags;
    LPWSTR lpszDefaultScheme;
} HIGHCONTRASTW, *LPHIGHCONTRASTW;

typedef HIGHCONTRASTA HIGHCONTRAST;
typedef LPHIGHCONTRASTA LPHIGHCONTRAST;

typedef struct
{
    UINT message;
    UINT paramL;
    UINT paramH;
    DWORD time;
    HWND hwnd;
} EVENTMSG, *LPEVENTMSG;




typedef struct
{
    POINT pt;
    HWND hwnd;
    UINT wHitTestCode;
    DWORD dwExtraInfo;
} MOUSEHOOKSTRUCT, *PMOUSEHOOKSTRUCT, *LPMOUSEHOOKSTRUCT;




typedef struct
{
    HWND hWnd;
    UINT wMessage;
    WPARAM wParam;
    LPARAM lParam;
} HARDWAREHOOKSTRUCT, *LPHARDWAREHOOKSTRUCT;




typedef struct
{
    DWORD idThread;
    DWORD idThreadInstaller;
    LPARAM lParam;
    WPARAM wParam;
    INT code;
} DEBUGHOOKINFO, *LPDEBUGHOOKINFO;
typedef struct tagANIMATIONINFO
{
       UINT cbSize;
       INT iMinAnimate;
} ANIMATIONINFO, *LPANIMATIONINFO;

typedef struct tagNMHDR
{
    HWND hwndFrom;
    UINT idFrom;
    UINT code;
} NMHDR, *LPNMHDR;

typedef struct
{
        UINT cbSize;
        INT iTabLength;
        INT iLeftMargin;
        INT iRightMargin;
        UINT uiLengthDrawn;
} DRAWTEXTPARAMS,*LPDRAWTEXTPARAMS;
typedef struct
{
   LPARAM lParam;
   WPARAM16 wParam;
   UINT16 message;
   HWND16 hwnd;
} CWPSTRUCT16, *LPCWPSTRUCT16;

typedef struct
{
  LPARAM lParam;
  WPARAM wParam;
  UINT message;
  HWND hwnd;
} CWPSTRUCT, *LPCWPSTRUCT;



typedef struct
{
  LRESULT lResult;
  LPARAM lParam;
  WPARAM16 wParam;
  DWORD message;
  HWND16 hwnd;
} CWPRETSTRUCT16, *LPCWPRETSTRUCT16;

typedef struct
{
  LRESULT lResult;
  LPARAM lParam;
  WPARAM wParam;
  DWORD message;
  HWND hwnd;
} CWPRETSTRUCT, *LPCWPRETSTRUCT;

typedef struct
{
    UINT length;
    UINT flags;
    UINT showCmd;
    POINT ptMinPosition __attribute__((packed));
    POINT ptMaxPosition __attribute__((packed));
    RECT rcNormalPosition __attribute__((packed));
} WINDOWPLACEMENT, *LPWINDOWPLACEMENT;
typedef struct tagCREATESTRUCTA
{
    LPVOID lpCreateParams;
    HINSTANCE hInstance;
    HMENU hMenu;
    HWND hwndParent;
    INT cy;
    INT cx;
    INT y;
    INT x;
    LONG style;
    LPCSTR lpszName;
    LPCSTR lpszClass;
    DWORD dwExStyle;
} CREATESTRUCTA, *LPCREATESTRUCTA;

typedef struct
{
    LPVOID lpCreateParams;
    HINSTANCE hInstance;
    HMENU hMenu;
    HWND hwndParent;
    INT cy;
    INT cx;
    INT y;
    INT x;
    LONG style;
    LPCWSTR lpszName;
    LPCWSTR lpszClass;
    DWORD dwExStyle;
} CREATESTRUCTW, *LPCREATESTRUCTW;

typedef CREATESTRUCTA CREATESTRUCT;
typedef LPCREATESTRUCTA LPCREATESTRUCT;

typedef struct
{
    HDC hdc;
    WIN_BOOL fErase;
    RECT rcPaint;
    WIN_BOOL fRestore;
    WIN_BOOL fIncUpdate;
    BYTE rgbReserved[32];
} PAINTSTRUCT, *PPAINTSTRUCT, *LPPAINTSTRUCT;

typedef struct
{
    HMENU hWindowMenu;
    UINT idFirstChild;
} CLIENTCREATESTRUCT, *LPCLIENTCREATESTRUCT;


typedef struct
{
    LPCSTR szClass;
    LPCSTR szTitle;
    HINSTANCE hOwner;
    INT x;
    INT y;
    INT cx;
    INT cy;
    DWORD style;
    LPARAM lParam;
} MDICREATESTRUCTA, *LPMDICREATESTRUCTA;

typedef struct
{
    LPCWSTR szClass;
    LPCWSTR szTitle;
    HINSTANCE hOwner;
    INT x;
    INT y;
    INT cx;
    INT cy;
    DWORD style;
    LPARAM lParam;
} MDICREATESTRUCTW, *LPMDICREATESTRUCTW;

typedef MDICREATESTRUCTA MDICREATESTRUCT;
typedef LPMDICREATESTRUCTA LPMDICREATESTRUCT;







typedef struct {
    DWORD styleOld;
    DWORD styleNew;
} STYLESTRUCT, *LPSTYLESTRUCT;
typedef struct
{
    POINT ptReserved;
    POINT ptMaxSize;
    POINT ptMaxPosition;
    POINT ptMinTrackSize;
    POINT ptMaxTrackSize;
} MINMAXINFO, *PMINMAXINFO, *LPMINMAXINFO;
typedef struct tagWINDOWPOS
{
    HWND hwnd;
    HWND hwndInsertAfter;
    INT x;
    INT y;
    INT cx;
    INT cy;
    UINT flags;
} WINDOWPOS, *PWINDOWPOS, *LPWINDOWPOS;
typedef struct
{
    RECT rgrc[3];
    WINDOWPOS *lppos;
} NCCALCSIZE_PARAMS, *LPNCCALCSIZE_PARAMS;
typedef struct
{
    UINT style;
    WNDPROC lpfnWndProc;
    INT cbClsExtra;
    INT cbWndExtra;
    HINSTANCE hInstance;
    HICON hIcon;
    HCURSOR hCursor;
    HBRUSH hbrBackground;
    LPCSTR lpszMenuName;
    LPCSTR lpszClassName;
} WNDCLASSA, *LPWNDCLASSA;

typedef struct
{
    UINT style;
    WNDPROC lpfnWndProc;
    INT cbClsExtra;
    INT cbWndExtra;
    HINSTANCE hInstance;
    HICON hIcon;
    HCURSOR hCursor;
    HBRUSH hbrBackground;
    LPCWSTR lpszMenuName;
    LPCWSTR lpszClassName;
} WNDCLASSW, *LPWNDCLASSW;

typedef WNDCLASSA WNDCLASS;
typedef LPWNDCLASSA LPWNDCLASS;

typedef struct {
    DWORD dwData;
    DWORD cbData;
    LPVOID lpData;
} COPYDATASTRUCT, *PCOPYDATASTRUCT, *LPCOPYDATASTRUCT;

typedef struct {
    HMENU hmenuIn;
    HMENU hmenuNext;
    HWND hwndNext;
} MDINEXTMENU, *PMDINEXTMENU, *LPMDINEXTMENU;


typedef struct {
        WORD size;
        WORD command;
        LONG data;
        LONG reserved;