diff --git a/utils/ipodpatcher/ipodio-win32.c b/utils/ipodpatcher/ipodio-win32.c index 9ef1a9fa76..db0623a6dc 100644 --- a/utils/ipodpatcher/ipodio-win32.c +++ b/utils/ipodpatcher/ipodio-win32.c @@ -39,33 +39,34 @@ #include "ipodio.h" -static int lock_volume(HANDLE hDisk) -{ +static int lock_volume(HANDLE hDisk) +{ DWORD dummy; return DeviceIoControl(hDisk, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, - &dummy, NULL); + &dummy, NULL); } -static int unlock_volume(HANDLE hDisk) -{ +static int unlock_volume(HANDLE hDisk) +{ DWORD dummy; return DeviceIoControl(hDisk, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL, 0, - &dummy, NULL); -} + &dummy, NULL); +} void ipod_print_error(char* msg) { LPSTR pMsgBuf = NULL; printf(msg); - FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | + if (FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), pMsgBuf, - 0, NULL); - printf(pMsgBuf); - LocalFree(pMsgBuf); + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&pMsgBuf, + 0, NULL)) { + printf(pMsgBuf); + LocalFree(pMsgBuf); + } } int ipod_open(struct ipod_t* ipod, int silent) @@ -223,4 +224,3 @@ ssize_t ipod_write(struct ipod_t* ipod, int nbytes) } #endif -