Skip to content

Commit

Permalink
win/ntfs: remove unused variable and have ntfssect use char API calls
Browse files Browse the repository at this point in the history
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@akeo.ie>
  • Loading branch information
pbatard authored and geneC committed Mar 9, 2016
1 parent 1ac927d commit b22a1fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions win/ntfssect.c
Expand Up @@ -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;
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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!");
Expand Down
4 changes: 2 additions & 2 deletions win/ntfssect.h
Expand Up @@ -39,15 +39,15 @@ 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,
LPDWORD
);

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

Expand Down

0 comments on commit b22a1fd

Please sign in to comment.