129{
131 WCHAR DevSerial[128];
132#ifdef _DEBUG
133 UCHAR cDevSerial[128];
135#endif
139
140
141
142 if(!LunExt) {
143
144 KdPrint((
"InitBadBlocks general\n"));
148 }
149
153
154
155
160
162
164 L"UniATA\\Parameters\\BadBlocks",
166
167#ifdef _DEBUG
169#else
171#endif
172 } else {
173
174 KdPrint((
"InitBadBlocks local\n"));
179
180#ifdef _DEBUG
181 KdPrint((
"LunExt %#x\n", LunExt));
183 cDevSerial[
i] = (
UCHAR)(DevSerial[
i]);
184 }
186 KdPrint((
"S/N:%s\n", cDevSerial));
187#endif
188
189 LunExt->nBadBlocks = 0;
190 LunExt->arrBadBlocks =
NULL;
191
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;
202 } else
204 KdPrint((
" deassociate BB list (by Serial)\n"));
206 cur->LunExt->nBadBlocks = 0;
207 cur->LunExt->arrBadBlocks =
NULL;
208 cur->LunExt->bbListDescr =
NULL;
210 }
211 }
212 }
213
215
222 cur->LunExt = LunExt;
223 LunExt->arrBadBlocks =
cur->arrBadBlocks;
224 LunExt->nBadBlocks =
cur->nBadBlocks;
225 LunExt->bbListDescr =
cur;
226 return;
227 }
228 }
229 }
230 }
231 return;
232}
ULONG EncodeVendorStr(OUT char *Buffer, IN PUCHAR Str, IN ULONG Length, IN ULONG Xorer)
#define DFLAGS_ATAPI_DEVICE
#define InitializeListHead(ListHead)
static NTSTATUS __stdcall BadBlockQueryRoutine(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
_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
_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 RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFCMRESLIST List