Make winedump compilable by MSVC.

This commit is contained in:
Dmitry Timoshkov 2002-08-26 21:47:41 +00:00 committed by Alexandre Julliard
parent a6affaa014
commit f59bebe514
3 changed files with 10 additions and 4 deletions

View file

@ -17,8 +17,10 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "winedump.h"
#include "config.h"
#include "winedump.h"
_globals globals; /* All global variables */

View file

@ -224,5 +224,5 @@ void fatal (const char *message)
perror (message);
else
puts (message);
do_usage ();
exit(1);
}

View file

@ -42,6 +42,10 @@
#include "winedump.h"
#include "pe.h"
#ifndef O_BINARY
# define O_BINARY 0
#endif
static void* base;
static unsigned long total_len;
static IMAGE_NT_HEADERS* nt_headers;
@ -649,7 +653,7 @@ static const char *get_resource_type( int id )
static void dump_data( const unsigned char *ptr, unsigned int size, const char *prefix )
{
int i, j;
unsigned int i, j;
printf( "%s", prefix );
for (i = 0; i < size; i++)
@ -822,7 +826,7 @@ int pe_analysis(const char* name, void (*fn)(void), enum FileSig wanted_sig)
setbuf(stdout, NULL);
fd = open(name, O_RDONLY);
fd = open(name, O_RDONLY | O_BINARY);
if (fd == -1) fatal("Can't open file");
if (fstat(fd, &s) < 0) fatal("Can't get size");