#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: cdf.c,v 1.68 2014/10/22 19:27:36 christos Exp $")
+FILE_RCSID("@(#)$File: cdf.c,v 1.69 2014/12/04 15:56:46 christos Exp $")
#endif
#include <assert.h>
goto out;
for (i = 0; i < sh.sh_properties; i++) {
size_t tail = (i << 1) + 1;
+ size_t ofs;
if (cdf_check_stream_offset(sst, h, p, tail * sizeof(uint32_t),
__LINE__) == -1)
goto out;
- size_t ofs = CDF_GETUINT32(p, tail);
+ ofs = CDF_GETUINT32(p, tail);
q = (const uint8_t *)(const void *)
((const char *)(const void *)p + ofs
- 2 * sizeof(uint32_t));
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.74 2014/10/26 20:23:30 christos Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.75 2014/12/04 15:56:46 christos Exp $")
#endif
#include "magic.h"
#endif
#include <string.h>
#include <errno.h>
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(WIN32)
#include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_WAIT_H
*/
/*
* file.h - definitions for file(1) program
- * @(#)$File: file.h,v 1.160 2014/11/28 02:46:39 christos Exp $
+ * @(#)$File: file.h,v 1.161 2014/12/04 15:56:46 christos Exp $
*/
#ifndef __file_h__
#include <regex.h>
#include <time.h>
#include <sys/types.h>
+#ifndef WIN32
#include <sys/param.h>
+#endif
/* Do this here and now, because struct stat gets re-defined on solaris */
#include <sys/stat.h>
#include <stdarg.h>
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: fsmagic.c,v 1.74 2014/10/13 20:21:49 christos Exp $")
+FILE_RCSID("@(#)$File: fsmagic.c,v 1.75 2014/12/04 15:56:46 christos Exp $")
#endif /* lint */
#include "magic.h"
#ifdef WIN32
{
- HANDLE hFile = CreateFile(fn, 0, FILE_SHARE_DELETE |
+ HANDLE hFile = CreateFile((LPCSTR)fn, 0, FILE_SHARE_DELETE |
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0,
NULL);
if (hFile != INVALID_HANDLE_VALUE) {
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: magic.c,v 1.89 2014/11/28 02:46:39 christos Exp $")
+FILE_RCSID("@(#)$File: magic.c,v 1.90 2014/12/04 15:56:46 christos Exp $")
#endif /* lint */
#include "magic.h"
#else
char *hmagicp;
char *tmppath = NULL;
+ LPTSTR dllpath;
hmagicpath = NULL;
#define APPENDPATH() \
}
/* Third, try to get magic file relative to dll location */
- LPTSTR dllpath = malloc(sizeof(*dllpath) * (MAX_PATH + 1));
+ dllpath = malloc(sizeof(*dllpath) * (MAX_PATH + 1));
dllpath[MAX_PATH] = 0; /* just in case long path gets truncated and not null terminated */
if (GetModuleFileNameA(NULL, dllpath, MAX_PATH)){
PathRemoveFileSpecA(dllpath);
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readcdf.c,v 1.48 2014/09/10 18:41:51 christos Exp $")
+FILE_RCSID("@(#)$File: readcdf.c,v 1.49 2014/12/04 15:56:46 christos Exp $")
#endif
#include <assert.h>
const char *mime;
} clsid2mime[] = {
{
- { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
+ { 0x00000000000c1084ULL, 0x46000000000000c0ULL },
"x-msi",
},
{ { 0, 0 },
},
}, clsid2desc[] = {
{
- { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
+ { 0x00000000000c1084ULL, 0x46000000000000c0ULL },
"MSI Installer",
},
{ { 0, 0 },
format_clsid(char *buf, size_t len, const uint64_t uuid[2]) {
snprintf(buf, len, "%.8" PRIx64 "-%.4" PRIx64 "-%.4" PRIx64 "-%.4"
PRIx64 "-%.12" PRIx64,
- (uuid[0] >> 32) & (uint64_t)0x000000000ffffffffLLU,
- (uuid[0] >> 16) & (uint64_t)0x0000000000000ffffLLU,
- (uuid[0] >> 0) & (uint64_t)0x0000000000000ffffLLU,
- (uuid[1] >> 48) & (uint64_t)0x0000000000000ffffLLU,
- (uuid[1] >> 0) & (uint64_t)0x0000fffffffffffffLLU);
+ (uuid[0] >> 32) & (uint64_t)0x000000000ffffffffULL,
+ (uuid[0] >> 16) & (uint64_t)0x0000000000000ffffULL,
+ (uuid[0] >> 0) & (uint64_t)0x0000000000000ffffULL,
+ (uuid[1] >> 48) & (uint64_t)0x0000000000000ffffULL,
+ (uuid[1] >> 0) & (uint64_t)0x0000fffffffffffffULL);
return buf;
}
#endif
int i;
const char *expn = "";
const char *corrupt = "corrupt: ";
+ const cdf_directory_t *root_storage;
info.i_fd = fd;
info.i_buf = buf;
goto out2;
}
- const cdf_directory_t *root_storage;
if ((i = cdf_read_short_stream(&info, &h, &sat, &dir, &sst,
&root_storage)) == -1) {
expn = "Cannot read short stream";
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: vasprintf.c,v 1.12 2014/05/14 23:09:21 christos Exp $")
+FILE_RCSID("@(#)$File: vasprintf.c,v 1.13 2014/12/04 15:56:46 christos Exp $")
#endif /* lint */
#include <assert.h>
#ifdef va_copy
va_copy (s.vargs, vargs);
#else
-#ifdef __va_copy
+# ifdef __va_copy
__va_copy (s.vargs, vargs);
-#else
+# else
+# ifdef WIN32
+ s.vargs = vargs;
+# else
memcpy (&s.vargs, &vargs, sizeof (s.va_args));
-#endif /* __va_copy */
+# endif /* WIN32 */
+# endif /* __va_copy */
#endif /* va_copy */
s.maxlen = (size_t)INT_MAX;