Iam using ReadDirectoryChangesW function in winAPI to know the access details of a file in a directory.the code is as follows...

        HANDLE h,hDir;
        ifstream myfile1;
        ofstream myfile2;
        char *buff="",temp[256]="";
        int i,length;
        Entry *head=NULL,*tail=NULL,*e=new Entry();

        BOOL b=ReadDirectoryChangesW(hDir,buff,1024,FALSE,FILE_NOTIFY_CHANGE_LAST_WRITE,NULL,NULL,NULL);
        DWORD d=GetLastError();

but i got the error 998 memory access violation.plz forgive me if any mistakes while using this function. Iam new to this fiel.Can any one help me.
Thanks in advance.

but i got the error 998 memory access violation

Than you're using some pointer which points to a restricted memory area.
Also, post the entire error, and do a debug of your program. See which pointer gets crazy...