Bug in Windows Sandbox? Blue screen crash

I’m always suspicious when someone claims a bug in Windows, but as far as I can tell, this code meets all documented requirements. If I’m wrong, please show me.

This minifilter code has worked for many years, but as soon as a Windows 10 computer starts Windows Sandbox, a page fault happens.

PostOperationCallback(PFLT_CALLBACK_DATA Data...)
{
	switch(Data->Iopb->MajorFunction)
	{
	case IRP_MJ_CREATE:
		{
			PECP_LIST EcpList = NULL;
			if (KeGetCurrentIrql() <= APC_LEVEL)
			{
				NTSTATUS status = FltGetEcpListFromCallbackData(Filter, Data, &EcpList);
				if((STATUS_SUCCESS == status) && (NULL != EcpList))
				{
					SRV_OPEN_ECP_CONTEXT* pEcpContext = NULL;
					ULONG EcpContextSize = 0;
					status = FltFindExtraCreateParameter(Filter, EcpList, &GUID_ECP_SRV_OPEN, (void*)&pEcpContext, &EcpContextSize);
					if((STATUS_SUCCESS == status) && (NULL != pEcpContext))
					{
						if(NULL != pEcpContext->SocketAddress)
						{
							switch(pEcpContext->SocketAddress->ss_family)   <---- causes page fault

I’m assuming the SocketAddress is paged out in this specific case, but only when Windows Sandbox is running?

I edited your post to format the code properly…

What does the !analyze -v say? Also, the output of:

?? pEcpContext

Would be interesting.

Thanks for the tip Scott.

?? pEcpContext
struct _SRV_OPEN_ECP_CONTEXT * 0xffff818479791158 +0x000 ShareName : 0xffffa28ddeab5658 _UNICODE_STRING “VSMBShare”
+0x008 SocketAddress : (null)
+0x010 OplockBlockState : 0 ‘’
+0x011 OplockAppState : 0 ‘’
+0x012 OplockFinalState : 0 ‘’

There is no way that code is crashing with this structure. The customer has to somehow be using the wrong driver because SocketAddress is checked for NULL (there was indeed an earlier bug where it wasn’t checked. Only in the Sandbox have we ever seen it to be null).

Sorry for the false alarm :frowning:

Doug

P.S. How did you reformat the code? I couldn’t see a way to do it (looked at the Markdown link)

@Doug_N That link in the forum doesn’t provide much help, does it. Why do they point to something with almost no content? I don’t know.

ANYhow… formatting code can be done in multiple ways, but most easily with what are called fenced code blocks.

Hope that helps,

Peter