[syslinux] [PATCH 2/5] ntfs: remove unused variable and have ntfssect use char API calls
Pete Batard
pete at akeo.ie
Wed Feb 24 05:02:28 PST 2016
The variable 'ok' is never used and generates a warning. Remove it. Also
ntfssect.c is designed to be compiled in non Unicode mode when using
MSVC compilers, so remove all ambiguity about it (LPCTSTR -> LPCSTR, use
of 'A' API calls) so that it doesn't break when compiled in Unicode
mode, which is what Rufus uses with MSVC.
-------------- next part --------------
From 93a7ece8449c7a9cd2634cfff0f5b6cf6d8b7c8a Mon Sep 17 00:00:00 2001
From: Pete Batard <pete at akeo.ie>
Date: Tue, 23 Feb 2016 19:45:11 +0000
Subject: [PATCH 2/5] ntfs: remove unused variable and have ntfssect use char
API calls
---
win/ntfssect.c | 8 ++++----
win/ntfssect.h | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/win/ntfssect.c b/win/ntfssect.c
index 8c2bcca..3dd6d7f 100644
--- a/win/ntfssect.c
+++ b/win/ntfssect.c
@@ -45,7 +45,7 @@ DWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent(
LARGE_INTEGER * Vcn,
S_NTFSSECT_EXTENT * Extent
) {
- BOOL bad, ok;
+ BOOL bad;
DWORD output_size, rc;
STARTING_VCN_INPUT_BUFFER input;
RETRIEVAL_POINTERS_BUFFER output;
@@ -60,7 +60,7 @@ DWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent(
return ERROR_INVALID_PARAMETER;
input.StartingVcn = *Vcn;
- ok = DeviceIoControl(
+ DeviceIoControl(
File,
FSCTL_GET_RETRIEVAL_POINTERS,
&input,
@@ -112,7 +112,7 @@ static DWORD NtfsSectGetVolumeHandle(
c[-1] = 0;
/* Open the volume */
- VolumeInfo->Handle = CreateFile(
+ VolumeInfo->Handle = CreateFileA(
volname,
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
@@ -302,7 +302,7 @@ DWORD M_NTFSSECT_API NtfsSectLoadXpFuncs(S_NTFSSECT_XPFUNCS * XpFuncs) {
XpFuncs->Size = sizeof *XpFuncs;
- XpFuncs->Kernel32 = LoadLibrary("kernel32.dll");
+ XpFuncs->Kernel32 = LoadLibraryA("kernel32.dll");
rc = GetLastError();
if (!XpFuncs->Kernel32) {
M_ERR("KERNEL32.DLL not found!");
diff --git a/win/ntfssect.h b/win/ntfssect.h
index 246c26d..f260af0 100644
--- a/win/ntfssect.h
+++ b/win/ntfssect.h
@@ -39,7 +39,7 @@ typedef struct S_NTFSSECT_XPFUNCS_ S_NTFSSECT_XPFUNCS;
/* The function type for Kernel32.dll's GetDiskFreeSpace() */
typedef BOOL WINAPI F_KERNEL32_GETDISKFREESPACE(
- LPCTSTR,
+ LPCSTR,
LPDWORD,
LPDWORD,
LPDWORD,
@@ -47,7 +47,7 @@ typedef BOOL WINAPI F_KERNEL32_GETDISKFREESPACE(
);
/* The function type for Kernel32.dll's GetVolumePathName() */
-typedef BOOL WINAPI F_KERNEL32_GETVOLUMEPATHNAME(LPCTSTR, LPCTSTR, DWORD);
+typedef BOOL WINAPI F_KERNEL32_GETVOLUMEPATHNAME(LPCSTR, LPCSTR, DWORD);
/*** Function declarations */
--
1.9.5.msysgit.1
More information about the Syslinux
mailing list