c++ - Get File Name which is currently writing in WriteFile -
bool winapi mywritefile( _in_ handle hfile, _in_ lpcvoid lpbuffer, _in_ dword nnumberofbytestowrite, _out_opt_ lpdword lpnumberofbyteswritten, _inout_opt_ lpoverlapped lpoverlapped ) { lptstr filepath; dword filepathlength=500; getfinalpathnamebyhandle(hfile,filepath,filepathlength,file_name_normalized); return writefile(hfile,lpbuffer,nnumberofbytestowrite,lpnumberofbyteswritten,lpoverlaped) }
this function written in dll implementing security of software in injected want file name writing. tried use getfinalpathnamebyhandle() in visual studio 2013 says getfinalpathnamebyhandle undefined. in regard appreciated.
edited
error list
error 2
error c3861: 'getfinalpathnamebyhandle': identifier not found test.cpp 132 test.cpp
intellisense: identifier "getfinalpathnamebyhandle" undefined test.cpp 132 test.cpp
edit 2
i included #include <fileapi.h> #include "stdafx.h" #include <iostream> #include <windows.h> #include <tchar.h> #include <stdio.h> #include <algorithm> #include <iterator> #include <assert.h> #include <fileapi.h>
but still getting same errors.
edit 3
problem solved removing these lines stdafx.h
#ifndef _win32_winnt // allow use of features specific windows xp or later. #define _win32_winnt 0x0501 // change appropriate value target other versions of windows. #endif
thank all
Comments
Post a Comment