[syslinux:master] win/ntfs: remove unused variable and have ntfssect use char API calls

syslinux-bot for Pete Batard pete at akeo.ie
Wed Mar 9 03:48:03 PST 2016


Commit-ID:  b22a1fdc5458cffc08a387eccd5d30e7ed74a9bb
Gitweb:     http://www.syslinux.org/commit/b22a1fdc5458cffc08a387eccd5d30e7ed74a9bb
Author:     Pete Batard <pete at akeo.ie>
AuthorDate: Wed, 2 Mar 2016 06:45:12 -0500
Committer:  Gene Cumm <gene.cumm at gmail.com>
CommitDate: Wed, 9 Mar 2016 06:33:58 -0500

win/ntfs: remove unused variable and have ntfssect use char API calls

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.

Signed-off-by: Pete Batard <pete at akeo.ie>

---
 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 */
 


More information about the Syslinux-commits mailing list