goto ReleaseRDS;
}
-
RtlCopyMemory(ReparseFile.Buffer, DeviceInformation->DeviceName.Buffer,
DeviceInformation->DeviceName.Length);
RtlCopyMemory((PVOID)((ULONG_PTR)ReparseFile.Buffer + DeviceInformation->DeviceName.Length),
- ReparseFile.Buffer, ReparseFile.Length);
+ ReparseIndex.Buffer, ReparseIndex.Length);
ReparseFile.Buffer[ReparseFile.Length / sizeof(WCHAR)] = UNICODE_NULL;
InitializeObjectAttributes(&ObjectAttributes,
/* When called, lock is already acquired */
- /* If noone, start to work */
- if (InterlockedIncrement(&(DeviceExtension->WorkerReferences)))
+ /* If noone (-1 as references), start to work */
+ if (InterlockedIncrement(&(DeviceExtension->WorkerReferences)) == 0)
{
IoQueueWorkItem(WorkItem->WorkItem, WorkerThread, DelayedWorkQueue, DeviceExtension);
}