85 cur->LunExt->nBadBlocks = 0;
86 cur->LunExt->arrBadBlocks =
NULL;
87 cur->LunExt->bbListDescr =
NULL;
99 if(
cur->arrBadBlocks) {
105 if(!
cur->arrBadBlocks) {
111 cur->SerNumStr[127] = 0;
116 for(
i=0;
i<
cur->nBadBlocks;
i++) {
117 KdPrint((
"BB: %I64x - %I64x\n",
cur->arrBadBlocks[
i].m_lbaStart,
cur->arrBadBlocks[
i].m_lbaEnd-1));
131 WCHAR DevSerial[128];
133 UCHAR cDevSerial[128];
144 KdPrint((
"InitBadBlocks general\n"));
164 L"UniATA\\Parameters\\BadBlocks",
174 KdPrint((
"InitBadBlocks local\n"));
181 KdPrint((
"LunExt %#x\n", LunExt));
183 cDevSerial[
i] = (
UCHAR)(DevSerial[
i]);
186 KdPrint((
"S/N:%s\n", cDevSerial));
189 LunExt->nBadBlocks = 0;
190 LunExt->arrBadBlocks =
NULL;
196 if(
cur->LunExt == LunExt) {
197 KdPrint((
" deassociate BB list (by LunExt)\n"));
198 cur->LunExt->nBadBlocks = 0;
199 cur->LunExt->arrBadBlocks =
NULL;
200 cur->LunExt->bbListDescr =
NULL;
204 KdPrint((
" deassociate BB list (by Serial)\n"));
206 cur->LunExt->nBadBlocks = 0;
207 cur->LunExt->arrBadBlocks =
NULL;
208 cur->LunExt->bbListDescr =
NULL;
222 cur->LunExt = LunExt;
223 LunExt->arrBadBlocks =
cur->arrBadBlocks;
224 LunExt->nBadBlocks =
cur->nBadBlocks;
225 LunExt->bbListDescr =
cur;
241 if(LunExt->bbListDescr) {
242 LunExt->bbListDescr->LunExt =
NULL;
243 LunExt->nBadBlocks = 0;
244 LunExt->arrBadBlocks =
NULL;
245 LunExt->bbListDescr =
NULL;
258 if (LunExt->nBadBlocks == 0)
265 ULONG nBadBlocks = LunExt->nBadBlocks;
271 for (
ULONG i = 0;
i < nBadBlocks;
i++)
274 lba < arrBadBlocks->m_lbaEnd) {
ULONG EncodeVendorStr(OUT char *Buffer, IN PUCHAR Str, IN ULONG Length, IN ULONG Xorer)
#define DFLAGS_ATAPI_DEVICE
struct _SBadBlockRange SBadBlockRange
struct _SBadBlockListItem * PSBadBlockListItem
#define InsertTailList(ListHead, Entry)
#define InitializeListHead(ListHead)
#define ExAllocatePool(type, size)
GLuint GLuint GLsizei count
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_In_ GUID _In_ PVOID ValueData
static NTSTATUS __stdcall BadBlockQueryRoutine(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
void NTAPI InitBadBlocks(IN PHW_LU_EXTENSION LunExt)
void NTAPI ForgetBadBlocks(IN PHW_LU_EXTENSION LunExt)
bool NTAPI CheckIfBadBlock(IN PHW_LU_EXTENSION LunExt, IN ULONGLONG lba, IN ULONG count)
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
_In_ PCWSTR _Inout_ _At_ QueryTable EntryContext
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
#define RTL_QUERY_REGISTRY_REQUIRED
#define RTL_REGISTRY_SERVICES
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG _In_ ULONG Length
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
struct _LIST_ENTRY * Flink
PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
ULONGLONG NTAPI UniAtaCalculateLBARegsBack(struct _HW_LU_EXTENSION *LunExt, ULONGLONG lba)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG _Out_opt_ PULONG _Out_opt_ PULONG ValueType
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG ValueLength
_Must_inspect_result_ _In_ WDFCMRESLIST List