#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include "volume.h"
Go to the source code of this file.
◆ CloseVolume()
Definition at line 68 of file volume.c.
69{
71}
static HANDLE hDiskVolume
Referenced by main().
◆ OpenVolume()
Definition at line 28 of file volume.c.
29{
31
32
33
34
35
36
37
38 if ((
_tcslen(lpszVolumeName) == 2) && (lpszVolumeName[1] ==
_T(
':')))
39 {
41 _tcscat(RealVolumeName, lpszVolumeName);
42 }
43 else
44 {
45 _tcscpy(RealVolumeName, lpszVolumeName);
46 }
47
48 _tprintf(
_T(
"Opening volume \'%s\'\n"), lpszVolumeName);
49
55 0,
57
59 {
63 }
64
66}
#define INVALID_HANDLE_VALUE
DWORD WINAPI GetLastError(void)
◆ ReadVolumeSector()
Definition at line 73 of file volume.c.
74{
75 DWORD dwNumberOfBytesRead;
78
79
80
81
82
83
84
85
87 if (dwFilePosition != (SectorNumber * 512))
88 {
92 }
93
95 if (!bRetVal || (dwNumberOfBytesRead != 512))
96 {
100 }
101
103}
#define ReadFile(a, b, c, d, e)
Referenced by BackupBootSector(), and InstallBootSector().
◆ WriteVolumeSector()
Definition at line 105 of file volume.c.
106{
107 DWORD dwNumberOfBytesWritten;
108 DWORD dwFilePosition;
110
111
112
113
114
115
116
117
119 if (dwFilePosition != (SectorNumber * 512))
120 {
124 }
125
127 if (!bRetVal || (dwNumberOfBytesWritten != 512))
128 {
132 }
133
135}
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Referenced by InstallBootSector().
◆ hDiskVolume