text:
/* Vista SP4 DDI version hardcoded instead of using the definition from sdkddkver.h,
as NT_PROCESSOR_GROUP has to be defined before ntddk.h->wdm.h and including
sdkddkver.h before ntddk.h cause compilation failure in wdm.h and ntddk.h */

#if NTDDI_VERSION > 0x06000400
#define NT_PROCESSOR_GROUPS
#endif

#include "ParaNdis6.h"
#include "ParaNdis-Oid.h"
#include "kdebugprint.h"
#include "ParaNdis_Debug.h"
#include "ParaNdis_DebugHistory.h"
#include "ParaNdis6_Driver.h"
#include "Trace.h"
#ifdef NETKVM_WPP_ENABLED
#include "ParaNdis6-Driver.tmh"
#endif

extern "C"
{
    static MINIPORT_ADD_DEVICE ParaNdis6_AddDevice;
    static MINIPORT_REMOVE_DEVICE ParaNdis6_RemoveDevice;
    static MINIPORT_INITIALIZE ParaNdis6_Initialize;
    static MINIPORT_HALT ParaNdis6_Halt;
    static MINIPORT_UNLOAD ParaNdis6_Unload;
    static MINIPORT_PAUSE ParaNdis6_Pause;
    static MINIPORT_RESTART ParaNdis6_Restart;
    static MINIPORT_CHECK_FOR_HANG ParaNdis6_CheckForHang;
    static MINIPORT_RESET ParaNdis6_Reset;
    static MINIPORT_SHUTDOWN ParaNdis6_AdapterShutdown;
    static MINIPORT_DEVICE_PNP_EVENT_NOTIFY ParaNdis6_DevicePnPEvent;
    static SET_OPTIONS ParaNdis6_SetOptions;
    static MINIPORT_SEND_NET_BUFFER_LISTS ParaNdis6_SendNetBufferLists;
#if NDIS_SUPPORT_NDIS61
    static MINIPORT_DIRECT_OID_REQUEST ParaNdis6x_DirectOidRequest;
    static MINIPORT_CANCEL_DIRECT_OID_REQUEST ParaNdis6x_CancelDirectOidRequest;
#endif
}

//#define NO_VISTA_POWER_MANAGEMENT
ULONG bDisableMSI = FALSE;

static NDIS_HANDLE      DriverHandle;
static LONG             gID = 0;

static const char *ConnectStateName(NDIS_MEDIA_CONNECT_STATE state)
{
    if (state == MediaConnectStateConnected) return "Connected";
    if (state == MediaConnectStateDisconnected) return "Disconnected";
    return "Unknown";
}

static VOID PostLinkState(PARANDIS_ADAPTER *pContext, NDIS_MEDIA_CONNECT_STATE connectState)
{
    NDIS_STATUS_INDICATION  indication;
    NDIS_LINK_STATE         state;
    NdisZeroMemory(&state, sizeof(state));
    state.Header.Revision = NDIS_LINK_STATE_REVISION_1;
    state.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
    state.Header.Size = NDIS_SIZEOF_LINK_STATE_REVISION_1;
    state.MediaConnectState = connectState;
    state.MediaDuplexState = MediaDuplexStateFull;
    state.RcvLinkSpeed = state.XmitLinkSpeed =
        connectState == MediaConnectStateConnected ?
            PARANDIS_MAXIMUM_RECEIVE_SPEED :
            NDIS_LINK_SPEED_UNKNOWN;
    state.PauseFunctions = NdisPauseFunctionsUnsupported;

    NdisZeroMemory(&indication, sizeof(indication));

    indication.Header.Type = NDIS_OBJECT_TYPE_STATUS_INDICATION;
    indication.Header.Revision = NDIS_STATUS_INDICATION_REVISION_1;
    indication.Header.Size = NDIS_SIZEOF_STATUS_INDICATION_REVISION_1;
    indication.SourceHandle = pContext->MiniportHandle;
    indication.StatusCode = NDIS_STATUS_LINK_STATE;
    indication.StatusBuffer = &state;
    indication.StatusBufferSize = sizeof(state);
    DPrintf(0, "Indicating %s\n", ConnectStateName(connectState));
    ParaNdis_DebugHistory(pContext, hopConnectIndication, NULL, connectState, 0, 0);
    NdisMIndicateStatusEx(pContext->MiniportHandle , &indication);
}

VOID ParaNdis_SetLinkState(PARANDIS_ADAPTER *pContext, NDIS_MEDIA_CONNECT_STATE LinkState)
{
    DEBUG_ENTRY(3);

    if (LinkState != pContext->fCurrentLinkState)
    {
        pContext->fCurrentLinkState = LinkState;
        PostLinkState(pContext, LinkState);
    }
}

VOID ParaNdis_SynchronizeLinkState(PARANDIS_ADAPTER *pContext)
{
    ParaNdis_SetLinkState(pContext, pContext->bConnected ? MediaConnectStateConnected
                                                         : MediaConnectStateDisconnected);
}

VOID ParaNdis_SendGratuitousArpPacket(PARANDIS_ADAPTER *pContext)
{
    pContext->guestAnnouncePackets.SendNBLs();
}

/**********************************************************
Required NDIS handler
Initialize adapter context, prepare it for operation,
set in PAUSED STATE
Return value:
    SUCCESS or kind of error
***********************************************************/
static NDIS_STATUS ParaNdis6_Initialize(
    NDIS_HANDLE miniportAdapterHandle,
    NDIS_HANDLE miniportDriverContext,
    PNDIS_MINIPORT_INIT_PARAMETERS miniportInitParameters)
{
    NDIS_MINIPORT_ADAPTER_ATTRIBUTES        miniportAttributes = {};
    NDIS_STATUS  status = NDIS_STATUS_SUCCESS;
    PARANDIS_ADAPTER *pContext = nullptr;
    PVOID UnalignedAdapterContext = nullptr;
    ULONG UnalignedAdapterContextSize;

    UNREFERENCED_PARAMETER(miniportDriverContext);
    DEBUG_ENTRY(0);
    /* allocate context structure and align it to cache boundary */
    UnalignedAdapterContextSize = sizeof(PARANDIS_ADAPTER) + NdisGetSharedDataAlignment();

    UnalignedAdapterContext =
        NdisAllocateMemoryWithTagPriority(
            miniportAdapterHandle,
            UnalignedAdapterContextSize,
            PARANDIS_MEMORY_TAG,
            NormalPoolPriority);

    if (!UnalignedAdapterContext)
    {
        DPrintf(0, "[%s] ERROR: Memory allocation failed!\n", __FUNCTION__);
        status = NDIS_STATUS_RESOURCES;
    }

    if (status == NDIS_STATUS_SUCCESS)
    {
        NdisZeroMemory(UnalignedAdapterContext, UnalignedAdapterContextSize);

        pContext = (PARANDIS_ADAPTER *)ALIGN_UP_POINTER_BY(UnalignedAdapterContext, NdisGetSharedDataAlignment());

        /* This call is for Static Driver Verifier only - has no real functionality*/
        __sdv_save_adapter_context((PVOID*)&pContext);

        pContext->UnalignedAdapterContext = UnalignedAdapterContext;
        pContext->UnalignedAdapterContextSize = UnalignedAdapterContextSize;

        /* set mandatory fields which Common use */
        pContext->ulUniqueID = NdisInterlockedIncrement(&gID);
        pContext->DriverHandle = DriverHandle;
        pContext->MiniportHandle = miniportAdapterHandle;

        new (&pContext->m_StateMachine) CMiniportStateMachine;
        new (&pContext->m_RxStateMachine) CDataFlowStateMachine;
        new (&pContext->m_CxStateMachine) CConfigFlowStateMachine;

        pContext->m_StateMachine.RegisterFlow(pContext->m_RxStateMachine);
        pContext->m_StateMachine.RegisterFlow(pContext->m_CxStateMachine);

        NdisZeroMemory(&miniportAttributes, sizeof(miniportAttributes));
        miniportAttributes.RegistrationAttributes.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES;
        miniportAttributes.RegistrationAttributes.Header.Revision = NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;
        miniportAttributes.RegistrationAttributes.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1;
        miniportAttributes.RegistrationAttributes.MiniportAdapterContext = pContext;
        miniportAttributes.RegistrationAttributes.AttributeFlags =
            // actual for USB
            // NDIS_MINIPORT_ATTRIBUTES_SURPRISE_REMOVE_OK
            NDIS_MINIPORT_ATTRIBUTES_HARDWARE_DEVICE |
            NDIS_MINIPORT_ATTRIBUTES_BUS_MASTER;
#ifndef NO_VISTA_POWER_MANAGEMENT
        miniportAttributes.RegistrationAttributes.AttributeFlags |= NDIS_MINIPORT_ATTRIBUTES_NO_HALT_ON_SUSPEND;
#endif
#if NDIS_SUPPORT_NDIS630
        miniportAttributes.RegistrationAttributes.AttributeFlags |= NDIS_MINIPORT_ATTRIBUTES_NO_PAUSE_ON_SUSPEND;
#endif
        miniportAttributes.RegistrationAttributes.CheckForHangTimeInSeconds = 4;
        miniportAttributes.RegistrationAttributes.InterfaceType = NdisInterfacePci;
        status = NdisMSetMiniportAttributes(miniportAdapterHandle, &miniportAttributes);
        if (status != NDIS_STATUS_SUCCESS)
        {
            DPrintf(0, "[%s] ERROR: NdisMSetMiniportAttributes 1 failed (%X)!\n", __FUNCTION__, status);
        }
    }

    if (status == NDIS_STATUS_SUCCESS)
    {
        /* prepare statistics struct for further reports */
        pContext->Statistics.Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
        pContext->Statistics.Header.Revision = NDIS_STATISTICS_INFO_REVISION_1;
        pContext->Statistics.Header.Size = NDIS_SIZEOF_STATISTICS_INFO_REVISION_1;
        /* let Common do all the rest */
        status = ParaNdis_InitializeContext(pContext, miniportInitParameters->AllocatedResources);
        if (status != NDIS_STATUS_SUCCESS)
        {
            DPrintf(0, "[%s] ERROR: ParaNdis6_InitializeContext failed (%X)!\n", __FUNCTION__, status);
        }
    }

    if (status == NDIS_STATUS_SUCCESS)
    {
        NDIS_PNP_CAPABILITIES power60Caps;
#if NDIS_SUPPORT_NDIS620
        NDIS_PM_CAPABILITIES power620Caps;
#endif
#ifdef NO_VISTA_POWER_MANAGEMENT
        pPowerCaps = NULL;
#endif
        ParaNdis_FillPowerCapabilities(&power60Caps);

        NdisZeroMemory(&miniportAttributes, sizeof(miniportAttributes));
        miniportAttributes.GeneralAttributes.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES;
        miniportAttributes.GeneralAttributes.Header.Revision = NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_1;
        miniportAttributes.GeneralAttributes.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_1;
#if NDIS_SUPPORT_NDIS620
        miniportAttributes.GeneralAttributes.Header.Revision = NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_2;
        miniportAttributes.GeneralAttributes.Header.Size = NDIS_SIZEOF_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_2;
        miniportAttributes.GeneralAttributes.PowerManagementCapabilitiesEx = &power620Caps;
        ParaNdis6_Fill620PowerCapabilities(&power620Caps);
#else
        miniportAttributes.GeneralAttributes.PowerManagementCapabilities = &power60Caps;
#endif
        miniportAttributes.GeneralAttributes.MediaType = NdisMedium802_3;
        miniportAttributes.GeneralAttributes.PhysicalMediumType = NdisPhysicalMedium802_3;
        miniportAttributes.GeneralAttributes.MtuSize = pContext->MaxPacketSize.nMaxDataSize;
        miniportAttributes.GeneralAttributes.LookaheadSize = pContext->MaxPacketSize.nMaxFullSizeOS;
        miniportAttributes.GeneralAttributes.MaxXmitLinkSpeed =
        miniportAttributes.GeneralAttributes.MaxRcvLinkSpeed  =  PARANDIS_FORMAL_LINK_SPEED;
        miniportAttributes.GeneralAttributes.MediaConnectState =
            pContext->bConnected ? MediaConnectStateConnected : MediaConnectStateDisconnected;
        miniportAttributes.GeneralAttributes.XmitLinkSpeed =
        miniportAttributes.GeneralAttributes.RcvLinkSpeed = pContext->bConnected ?
            PARANDIS_FORMAL_LINK_SPEED : NDIS_LINK_SPEED_UNKNOWN;
        miniportAttributes.GeneralAttributes.MediaDuplexState = MediaDuplexStateFull;
        miniportAttributes.GeneralAttributes.MacOptions =
                    NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA |       /* NIC has no internal loopback support */
                    NDIS_MAC_OPTION_TRANSFERS_NOT_PEND  |       /* Must be set since using  NdisMIndicateReceivePacket */
                    NDIS_MAC_OPTION_NO_LOOPBACK;                /* NIC has no internal loopback support */
        if (IsPrioritySupported(pContext))
            miniportAttributes.GeneralAttributes.MacOptions |= NDIS_MAC_OPTION_8021P_PRIORITY;
        if (IsVlanSupported(pContext))
            miniportAttributes.GeneralAttributes.MacOptions |= NDIS_MAC_OPTION_8021Q_VLAN;
        miniportAttributes.GeneralAttributes.SupportedPacketFilters = PARANDIS_PACKET_FILTERS;
        miniportAttributes.GeneralAttributes.MaxMulticastListSize = PARANDIS_MULTICAST_LIST_SIZE;
        miniportAttributes.GeneralAttributes.MacAddressLength =     ETH_ALEN;

#if PARANDIS_SUPPORT_RSS
        if (pContext->bRSSOffloadSupported)
        {
            miniportAttributes.GeneralAttributes.RecvScaleCapabilities =
                ParaNdis6_RSSCreateConfiguration(
                                                &pContext->RSSParameters,
                                                &pContext->RSSCapabilities,
                                                pContext->RSSMaxQueuesNumber);
            pContext->bRSSInitialized = TRUE;
        }

        new (&pContext->RSSParameters.rwLock) CNdisRWLock();
        if (!pContext->RSSParameters.rwLock.Create(pContext->MiniportHandle))
        {
            DPrintf(0, "RSS RW lock allocation failed\n");
            status = NDIS_STATUS_RESOURCES;
        }

        for(ULONG i = 0; i < ARRAYSIZE(pContext->ReceiveQueues); i++)
        {
            NdisAllocateSpinLock(&pContext->ReceiveQueues[i].Lock);
            InitializeListHead(&pContext->ReceiveQueues[i].BuffersList);
        }

        pContext->ReceiveQueuesInitialized = TRUE;
#endif

        miniportAttributes.GeneralAttributes.AccessType = NET_IF_ACCESS_BROADCAST;
        miniportAttributes.GeneralAttributes.DirectionType = NET_IF_DIRECTION_SENDRECEIVE;
        miniportAttributes.GeneralAttributes.IfType = IF_TYPE_ETHERNET_CSMACD;
        miniportAttributes.GeneralAttributes.IfConnectorPresent = TRUE;
        miniportAttributes.GeneralAttributes.ConnectionType = NET_IF_CONNECTION_DEDICATED;

        ETH_COPY_NETWORK_ADDRESS(miniportAttributes.GeneralAttributes.PermanentMacAddress, pContext->PermanentMacAddress);
        ETH_COPY_NETWORK_ADDRESS(miniportAttributes.GeneralAttributes.CurrentMacAddress, pContext->CurrentMacAddress);

        ParaNdis6_GetSupportedOid(&miniportAttributes.GeneralAttributes);
        /* update also SupportedStatistics in ready to use statistics block */
        pContext->Statistics.SupportedStatistics = ParaNdis6_GetSupportedStatisticsFlags();
        status = NdisMSetMiniportAttributes(miniportAdapterHandle, &miniportAttributes);
        if (status != NDIS_STATUS_SUCCESS)
        {
            DPrintf(0, "[%s] ERROR: NdisMSetMiniportAttributes 2 failed (%X)!\n", __FUNCTION__, status);
        }
    }

    if (pContext && status != NDIS_STATUS_SUCCESS && status != NDIS_STATUS_PENDING)
    {
#if PARANDIS_SUPPORT_RSS
        pContext->RSSParameters.rwLock.~CNdisRWLock();

        if (pContext->ReceiveQueuesInitialized)
        {
            ULONG i;

            for (i = 0; i < ARRAYSIZE(pContext->ReceiveQueues); i++)
            {
                NdisFreeSpinLock(&pContext->ReceiveQueues[i].Lock);
            }
        }
#endif

        pContext->m_StateMachine.UnregisterFlow(pContext->m_RxStateMachine);
        pContext->m_StateMachine.UnregisterFlow(pContext->m_CxStateMachine);
        pContext->m_StateMachine.NotifyHalted();

        pContext->m_CxStateMachine.~CConfigFlowStateMachine();
        pContext->m_RxStateMachine.~CDataFlowStateMachine();
        pContext->m_StateMachine.~CMiniportStateMachine();

        NdisFreeMemory(pContext->UnalignedAdapterContext, 0, 0);
        pContext = NULL;
    }

    if (pContext && status == NDIS_STATUS_SUCCESS)
    {
        status = ParaNdis_FinishInitialization(pContext);
        if (status != NDIS_STATUS_SUCCESS)
        {
            ParaNdis_CleanupContext(pContext);
            NdisFreeMemory(pContext->UnalignedAdapterContext, 0, 0);
            pContext = NULL;
        }
    }
    if (pContext && status == NDIS_STATUS_SUCCESS)
    {
        if (NDIS_STATUS_SUCCESS ==
            ParaNdis6_GetRegistrationOffloadInfo(pContext,
                &miniportAttributes.OffloadAttributes))
            status = NdisMSetMiniportAttributes(miniportAdapterHandle, &miniportAttributes);
            if (status != NDIS_STATUS_SUCCESS)
            {
                DPrintf(0, "[%s] ERROR: NdisMSetMiniportAttributes 3 failed (%X)!\n", __FUNCTION__, status);
            }
    }

    if (pContext && status == NDIS_STATUS_SUCCESS)
    {
        pContext->m_StateMachine.NotifyInitialized();
        ParaNdis_DebugRegisterMiniport(pContext, TRUE);
    }

    DEBUG_EXIT_STATUS(status ? 0 : 2, status);
    return status;
}

/**********************************************************
called at IRQL = PASSIVE_LEVEL
Called on disable, on removal, on standby (if required)
***********************************************************/
static VOID ParaNdis6_Halt(NDIS_HANDLE miniportAdapterContext, NDIS_HALT_ACTION haltAction)
{
    PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)miniportAdapterContext;
    DEBUG_ENTRY(0);
    ParaNdis_DebugHistory(pContext, hopHalt, NULL, 1, haltAction, 0);
    ParaNdis_CleanupContext(pContext);
    ParaNdis_DebugHistory(pContext, hopHalt, NULL, 0, 0, 0);
    ParaNdis_DebugRegisterMiniport(pContext, FALSE);
    NdisFreeMemory(pContext->UnalignedAdapterContext, 0, 0);
    DEBUG_EXIT_STATUS(2, 0);
}

/**********************************************************
Deregister driver
Clean up WPP
***********************************************************/
static VOID ParaNdis6_Unload(IN PDRIVER_OBJECT pDriverObject)
{
    DEBUG_ENTRY(0);
    if (DriverHandle) NdisMDeregisterMiniportDriver(DriverHandle);
    DEBUG_EXIT_STATUS(2, 0);
    ParaNdis_DebugCleanup(pDriverObject);
#ifdef NETKVM_WPP_ENABLED
    WPP_CLEANUP(pDriverObject);
#endif // WPP
}

/**********************************************************
Required NDIS handler
called at IRQL = PASSIVE_LEVEL
Must pause RX and TX
Called before halt, on standby,
upon protocols activation
***********************************************************/
static NDIS_STATUS ParaNdis6_Pause(
        NDIS_HANDLE miniportAdapterContext,
        PNDIS_MINIPORT_PAUSE_PARAMETERS)
{
    DEBUG_ENTRY(0);
    static_cast<PPARANDIS_ADAPTER>(miniportAdapterContext)->m_StateMachine.NotifyPaused();
    return NDIS_STATUS_SUCCESS;
}

/**********************************************************
Required NDIS handler
called at IRQL = PASSIVE_LEVEL
Must pause RX and TX
Called upon startup, on resume,
upon protocols activation
***********************************************************/
static NDIS_STATUS ParaNdis6_Restart(
    NDIS_HANDLE miniportAdapterContext,
    PNDIS_MINIPORT_RESTART_PARAMETERS)
{
    DEBUG_ENTRY(0);
    static_cast<PPARANDIS_ADAPTER>(miniportAdapterContext)->m_StateMachine.NotifyRestarted();
    return NDIS_STATUS_SUCCESS;
}

/**********************************************************
Required NDIS handler
called at IRQL <= DISPATCH_LEVEL
***********************************************************/
static VOID ParaNdis6_SendNetBufferLists(
    NDIS_HANDLE miniportAdapterContext,
    PNET_BUFFER_LIST    pNBL,
    NDIS_PORT_NUMBER    portNumber,
    ULONG               flags/* sendFlags */)
{
    PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)miniportAdapterContext;
    UNREFERENCED_PARAMETER(portNumber);
    UNREFERENCED_PARAMETER(flags);
#ifdef PARANDIS_SUPPORT_RSS
    CNdisPassiveReadAutoLock autoLock(pContext->RSSParameters.rwLock);
    if (pContext->RSS2QueueMap != nullptr)
    {
        while (pNBL)
        {
            ULONG RSSHashValue = NET_BUFFER_LIST_GET_HASH_VALUE(pNBL);
            ULONG indirectionIndex = RSSHashValue & (pContext->RSSParameters.ActiveRSSScalingSettings.RSSHashMask);

            PNET_BUFFER_LIST nextNBL = NET_BUFFER_LIST_NEXT_NBL(pNBL);
            NET_BUFFER_LIST_NEXT_NBL(pNBL) = NULL;

            pContext->RSS2QueueMap[indirectionIndex]->txPath.Send(pNBL);
            pNBL = nextNBL;
        }
    }
    else
    {
        pContext->pPathBundles[0].txPath.Send(pNBL);
    }
#else
    pContext->pPathBundles[0].txPath.Send(pNBL);
#endif
}

/**********************************************************
Required NDIS handler: happens unually each 2 second
***********************************************************/
static BOOLEAN ParaNdis6_CheckForHang(NDIS_HANDLE miniportAdapterContext)
{
    UNREFERENCED_PARAMETER(miniportAdapterContext);
    return FALSE;
}

/**********************************************************
Required NDIS handler for RESET operation
Never happens under normal condition, only if
OID or other call returns PENDING and not completed or if
ParaNdis6_CheckForHang returns true
***********************************************************/
static NDIS_STATUS ParaNdis6_Reset(
        NDIS_HANDLE miniportAdapterContext,
        PBOOLEAN  pAddressingReset)
{
    UNREFERENCED_PARAMETER(miniportAdapterContext);
    *pAddressingReset = FALSE;
    return NDIS_STATUS_SUCCESS;
}

/***************************************************
Required NDIS handler for adapter shutdown
should not call NDIS functions
The reason may be a system shutdown ( IRQL <= DPC)
may be bugcheck (arbitrary IRQL)
***************************************************/
static VOID ParaNdis6_AdapterShutdown(
    NDIS_HANDLE miniportAdapterContext,
    NDIS_SHUTDOWN_ACTION  shutdownAction)
{
    if (shutdownAction == NdisShutdownBugCheck)
    {
        return;
    }
    PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)miniportAdapterContext;

    ParaNdis_OnShutdown(pContext);
}

/**********************************************************
Required NDIS handler for PnP event
***********************************************************/
static VOID ParaNdis6_DevicePnPEvent(
    NDIS_HANDLE miniportAdapterContext,
    PNET_DEVICE_PNP_EVENT pNetEvent)
{
    PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)miniportAdapterContext;
    ParaNdis_OnPnPEvent(pContext,
        pNetEvent->DevicePnPEvent,
        pNetEvent->InformationBuffer,
        pNetEvent->InformationBufferLength);

}

static NDIS_STATUS  ParaNdis6_AddDevice(IN NDIS_HANDLE  MiniportAdapterHandle, IN NDIS_HANDLE  MiniportDriverContext)
{
    NDIS_MINIPORT_ADAPTER_ATTRIBUTES  MiniportAttributes;
    NDIS_STATUS status;

    UNREFERENCED_PARAMETER(MiniportDriverContext);

    DEBUG_ENTRY(0);
    MiniportAttributes.AddDeviceRegistrationAttributes.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_ADD_DEVICE_REGISTRATION_ATTRIBUTES;
    MiniportAttributes.AddDeviceRegistrationAttributes.Header.Revision = NDIS_MINIPORT_ADD_DEVICE_REGISTRATION_ATTRIBUTES_REVISION_1;
    MiniportAttributes.AddDeviceRegistrationAttributes.Header.Size = NDIS_SIZEOF_MINIPORT_ADD_DEVICE_REGISTRATION_ATTRIBUTES_REVISION_1;
    MiniportAttributes.AddDeviceRegistrationAttributes.MiniportAddDeviceContext = MiniportAdapterHandle;
    MiniportAttributes.AddDeviceRegistrationAttributes.Flags = 0;
    status = NdisMSetMiniportAttributes(MiniportAdapterHandle, &MiniportAttributes);
    return status;
}

static VOID ParaNdis6_RemoveDevice (IN NDIS_HANDLE  MiniportAddDeviceContext)
{
    UNREFERENCED_PARAMETER(MiniportAddDeviceContext);

    DEBUG_ENTRY(0);
}

static NDIS_STATUS ParaNdis6_StartDevice(IN NDIS_HANDLE  MiniportAddDeviceContext, IN PIRP  Irp)
{
    NDIS_STATUS status = NDIS_STATUS_SUCCESS;

    UNREFERENCED_PARAMETER(MiniportAddDeviceContext);
    UNREFERENCED_PARAMETER(Irp);

    DEBUG_ENTRY(0);
    return status;
}

typedef struct _tagRRLData
{
    PIO_RESOURCE_REQUIREMENTS_LIST prrl;
    PIO_RESOURCE_LIST currentList;
    PIO_RESOURCE_DESCRIPTOR currentDesc;
}tRRLData;

/******************************************************************
Replacement of resource requirement list: initialize the new list
*******************************************************************/
static void InitializeNewResourceRequirementsList(
    tRRLData *pData,
    PIO_RESOURCE_REQUIREMENTS_LIST newList,
    PIO_RESOURCE_REQUIREMENTS_LIST oldList)
{
    pData->prrl = newList;
    pData->currentList = NULL;
    pData->currentDesc = NULL;
    if (pData->prrl)
    {
        ULONG len = RtlPointerToOffset(pData->prrl, &pData->prrl->List[0]);
        RtlCopyMemory(newList, oldList, len);
        newList->ListSize = len;
        newList->AlternativeLists = 0;
    }
}

/******************************************************************
Replacement of resource requirement list: adding new resource list
to existing resource requirement list
*******************************************************************/
static void AddNewResourceList(tRRLData *pData, PIO_RESOURCE_LIST pior)
{
    if (pData->prrl)
    {
        ULONG len = RtlPointerToOffset(pior, &pior->Descriptors[0]);
        pData->currentList = (PIO_RESOURCE_LIST)RtlOffsetToPointer(pData->prrl, pData->prrl->ListSize);
        RtlCopyMemory(pData->currentList, pior, len);
        pData->currentList->Count = 0;
        pData->prrl->ListSize += len;
        pData->prrl->AlternativeLists++;
        pData->currentDesc = &pData->currentList->Descriptors[0];
    }
}

/******************************************************************
Replacement of resource requirement list: done with new resource list,
verify if it contains all the required resources
*******************************************************************/
static void FinalizeResourceList(tRRLData *pData)
{
    if (pData->prrl && pData->currentList)
    {
        BOOLEAN bFound = FALSE;
        ULONG len = RtlPointerToOffset(pData->currentList, &pData->currentList->Descriptors[0]);
        UINT i;
        for (i = 0; i < pData->currentList->Count && !bFound; ++i)
        {
            len += sizeof(IO_RESOURCE_DESCRIPTOR);
            if (pData->currentList->Descriptors[i].Type == CmResourceTypeInterrupt) bFound = TRUE;
        }
        if (!bFound)
        {
            pData->prrl->AlternativeLists--;
            pData->prrl->ListSize -= len;
        }
    }
}

/******************************************************************
Replacement of resource requirement list: adding new resource descriptor
to current resource list
*******************************************************************/
static void AddNewResourceDescriptor(tRRLData *pData, PIO_RESOURCE_DESCRIPTOR prd)
{
    if (pData->prrl && pData->currentList && pData->currentDesc)
    {
        *(pData->currentDesc) = *prd;
        pData->currentList->Count++;
        pData->prrl->ListSize += sizeof(IO_RESOURCE_DESCRIPTOR);
        pData->currentDesc++;
    }
}

static void PrintPRRL(PIO_RESOURCE_REQUIREMENTS_LIST prrl)
{
    PIO_RESOURCE_LIST list;

    list = prrl->List;

    for (ULONG ix = 0; ix < prrl->AlternativeLists; ++ix)
    {
        DPrintf(0, "[%s] List # %ld, count %lu\n", __FUNCTION__, ix, list->Count);
        for (ULONG jx = 0; jx < list->Count; ++jx)
        {
            PIO_RESOURCE_DESCRIPTOR desc;

            desc = list->Descriptors + jx;

            switch (desc->Type)
            {
            case CmResourceTypePort:
                DPrintf(0, "CmResourceTypePort, align 0x%lx, length %lu, min/max 0x%llx/0x%llx\n", desc->u.Port.Alignment, desc->u.Port.Length, desc->u.Port.MinimumAddress.QuadPart, desc->u.Port.MaximumAddress.QuadPart);
                break;
            case CmResourceTypeInterrupt:
                DPrintf(0, "CmResourceTypeInterrupt, max/min 0x%lx/0x%lx affinity 0x%llx\n", desc->u.Interrupt.MinimumVector, desc->u.Interrupt.MaximumVector, desc->u.Interrupt.TargetedProcessors);
                break;
            case CmResourceTypeMemory:
                DPrintf(0, "CmResourceTypeMemory align %lu, length %lu, min 0x%llx, max 0x%llx\n", desc->u.Memory.Alignment, desc->u.Memory.Length, desc->u.Memory.MinimumAddress.QuadPart, desc->u.Memory.MaximumAddress.QuadPart);
                break;
            default:
                break;
            }
        }
        list = (PIO_RESOURCE_LIST)(list->Descriptors + list->Count);
    }
}

static void SetupInterrruptAffinity(PIO_RESOURCE_REQUIREMENTS_LIST prrl)
{
    PIO_RESOURCE_LIST list;
    ULONG procIndex = 0;

    list = prrl->List;

    for (ULONG ix = 0; ix < prrl->AlternativeLists; ++ix)
    {
        for (ULONG jx = 0; jx < list->Count; ++jx)
        {
            PIO_RESOURCE_DESCRIPTOR desc;

            desc = list->Descriptors + jx;

            if (desc->Type == CmResourceTypeInterrupt && (desc->Flags & CM_RESOURCE_INTERRUPT_MESSAGE))
            {
                desc->u.Interrupt.AffinityPolicy = IrqPolicySpecifiedProcessors;
#if defined(NT_PROCESSOR_GROUPS)
                PROCESSOR_NUMBER procNumber;
                NDIS_STATUS status;

                status = KeGetProcessorNumberFromIndex(procIndex, &procNumber);
                if (status == STATUS_SUCCESS)
                {
                    desc->Flags |= CM_RESOURCE_INTERRUPT_POLICY_INCLUDED;
                    desc->u.Interrupt.Group = procNumber.Group;
                    desc->u.Interrupt.TargetedProcessors = 1i64 << procNumber.Number;
                }
                else
                {
                    DPrintf(0, "[%s] - can't convert index %u into processor number\n", __FUNCTION__, procIndex);
                }
#else
                desc->u.Interrupt.TargetedProcessors = 1i64 << procIndex;
#endif
                if (jx % 2 == 1)
                {
                    procIndex++;

                    if (procIndex == ParaNdis_GetSystemCPUCount())
                    {
                        procIndex = 0;
                    }
                }
            }
        }
        list = (PIO_RESOURCE_LIST)(list->Descriptors + list->Count);
    }
}

/******************************************************************
Replacement of resource requirement list, when needed:
The procedure traverses over all the resource lists in existing resource requirement list
(we receive it in IRP information field).
When the driver is not built to work with MSI resources, we must remove them from the
resource requirement list, otherwise the driver will fail to initialize
Typically MSI interrupts are labeled as preferred ones, when line interrupts are labeled as
alternative resources. Removing message interrupts, remove also "alternative" label from line interrupts.
*******************************************************************/
static PIO_RESOURCE_REQUIREMENTS_LIST ParseFilterResourceIrp(
    IN NDIS_HANDLE  MiniportAddDeviceContext,
    PIO_RESOURCE_REQUIREMENTS_LIST prrl,
    BOOLEAN bRemoveMSIResources)
{
    tRRLData newRRLData;
    ULONG nRemoved = 0;
    UINT nInterrupts = 0;
    PIO_RESOURCE_REQUIREMENTS_LIST newPrrl = NULL;
    ULONG QueueNumber;
    BOOLEAN MSIResourceListed = FALSE;
#if NDIS_SUPPORT_NDIS620
    QueueNumber = NdisGroupActiveProcessorCount(ALL_PROCESSOR_GROUPS) * 2 + 1;
#elif NDIS_SUPPORT_NDIS6
    QueueNumber = NdisSystemProcessorCount() * 2 + 1;
#else
    QueueNumber = 0; /* Don't create MSI resource descriptors*/
#endif

    if (QueueNumber > 2048)
        QueueNumber = 2048;

    DPrintf(0, "[%s]%s\n", __FUNCTION__, bRemoveMSIResources ? "(Remove MSI resources...)" : "(Don't remove MSI resources)");

    newPrrl = (PIO_RESOURCE_REQUIREMENTS_LIST)NdisAllocateMemoryWithTagPriority(
            MiniportAddDeviceContext,
            prrl->ListSize + (bRemoveMSIResources ? 0 : QueueNumber * sizeof(IO_RESOURCE_DESCRIPTOR)),
            PARANDIS_MEMORY_TAG,
            NormalPoolPriority);

    InitializeNewResourceRequirementsList(&newRRLData, newPrrl, prrl);
    if (prrl)
    {
        ULONG n, offset;
        PVOID p = &prrl->List[0];
        DPrintf(0, "[%s] %d bytes, %d lists\n", __FUNCTION__, prrl->ListSize, prrl->AlternativeLists);
        offset = RtlPointerToOffset(prrl, p);
        for (n = 0; n < prrl->AlternativeLists && offset < prrl->ListSize; ++n)
        {
            ULONG nDesc;
            IO_RESOURCE_LIST *pior = (IO_RESOURCE_LIST *)p;
            if ((offset + sizeof(*pior)) < prrl->ListSize)
            {
                IO_RESOURCE_DESCRIPTOR *pd = &pior->Descriptors[0];
                DPrintf(0, "[%s]+%d %d:%d descriptors follow\n", __FUNCTION__, offset, n, pior->Count);
                offset += RtlPointerToOffset(p, pd);
                AddNewResourceList(&newRRLData, pior);
                for (nDesc = 0; nDesc < pior->Count; ++nDesc)
                {
                    BOOLEAN bRemove = FALSE;
                    if ((offset + sizeof(*pd)) <= prrl->ListSize)
                    {
                        if (pd->Type == CmResourceTypeInterrupt)
                        {
                            nInterrupts++;
                            DPrintf(0, "[%s] CmResourceTypeInterrupt, min/max = %lx/%lx Option = 0x%lx, ShareDisposition = %u \n", __FUNCTION__, pd->u.Interrupt.MinimumVector, pd->u.Interrupt.MaximumVector,
                                pd->Option, pd->ShareDisposition);
                            if (pd->Flags & CM_RESOURCE_INTERRUPT_MESSAGE)
                            {
                                MSIResourceListed = TRUE;
                                bRemove = bRemoveMSIResources;
                            }
                            else
                            {
                                // reset IO_RESOURCE_ALTERNATIVE attribute on Line Interrupt,
                                // if we remove MSI vectors, otherwise Windows will not allocate it for the device
                                if (bRemoveMSIResources && (pd->Option & IO_RESOURCE_ALTERNATIVE))
                                {
                                    pd->Option &= ~IO_RESOURCE_ALTERNATIVE;
                                }
                            }
                        }
                        if (!bRemove) AddNewResourceDescriptor(&newRRLData, pd);
                        else nRemoved++;
                    }
                    offset += sizeof(*pd);
                    pd = (IO_RESOURCE_DESCRIPTOR *)RtlOffsetToPointer(prrl, offset);
                }

                DPrintf(0, "[%s] MSI resources %s listed\n", __FUNCTION__, MSIResourceListed ? "" : "not");

                FinalizeResourceList(&newRRLData);
                p = pd;
            }
        }
    }
    if (!bRemoveMSIResources)
    {
        SetupInterrruptAffinity(newPrrl);
    }
    if (bRemoveMSIResources && nRemoved)
    {
        DPrintf(0, "[%s] %d resources removed\n", __FUNCTION__, nRemoved);
    }
    return newPrrl;
}

/******************************************************************
Registered procedure for filtering if resource requirement
Required when the device supports MSI, but the driver decides - will it work with MSI or not
(currently MSI is supported but does not work, exactly our case).
In this case the resource requirement list must be replaced - we need to remove from it
all the "message interrupt" resources.

When we are ready to work with MSI (VIRTIO_USE_MSIX_INTERRUPT is DEFINED),
we just enumerate allocated resources and do not modify them.
*******************************************************************/
static NDIS_STATUS ParaNdis6_FilterResource(IN NDIS_HANDLE  MiniportAddDeviceContext, IN PIRP  Irp)
{
    DPrintf(0, "[%s] entered\n", __FUNCTION__);
    PIO_RESOURCE_REQUIREMENTS_LIST prrl = (PIO_RESOURCE_REQUIREMENTS_LIST)(PVOID)Irp->IoStatus.Information;

    PrintPRRL(prrl);

    PIO_RESOURCE_REQUIREMENTS_LIST newPrrl = ParseFilterResourceIrp(MiniportAddDeviceContext, prrl, BOOLEAN(bDisableMSI));

    if (newPrrl)
    {
        Irp->IoStatus.Information = (ULONG_PTR)newPrrl;
        NdisFreeMemory(prrl, 0, 0);
        PrintPRRL(newPrrl);
    }
    else
    {
        DPrintf(0, "[%s] Resource requirement unchanged\n", __FUNCTION__);
    }
    return NDIS_STATUS_SUCCESS;
}

/******************************************************************************
This procedure required when we want to be able filtering resource requirements.
ParaNdis6_AddDevice need to register context (to allow other procedures to allocate memory)
ParaNdis6_FilterResource able to replace resource requirements list if needed
ParaNdis6_RemoveDevice does not do anything if other procedures do not allocate any resources
 which must be freed upon device removal
******************************************************************************/
static NDIS_STATUS ParaNdis6_SetOptions(IN  NDIS_HANDLE NdisDriverHandle, IN  NDIS_HANDLE DriverContext)
{
    NDIS_STATUS status;
    NDIS_MINIPORT_PNP_CHARACTERISTICS pnpChars;

    UNREFERENCED_PARAMETER(DriverContext);

    pnpChars.Header.Type = NDIS_OBJECT_TYPE_MINIPORT_PNP_CHARACTERISTICS;
    pnpChars.Header.Revision = NDIS_MINIPORT_PNP_CHARACTERISTICS_REVISION_1;
    pnpChars.Header.Size = NDIS_SIZEOF_MINIPORT_PNP_CHARACTERISTICS_REVISION_1;
    pnpChars.MiniportAddDeviceHandler = ParaNdis6_AddDevice;
    pnpChars.MiniportRemoveDeviceHandler = ParaNdis6_RemoveDevice;
    pnpChars.MiniportStartDeviceHandler = ParaNdis6_StartDevice;
    pnpChars.MiniportFilterResourceRequirementsHandler = ParaNdis6_FilterResource;
    status = NdisSetOptionalHandlers(NdisDriverHandle, (PNDIS_DRIVER_OPTIONAL_HANDLERS)&pnpChars);
    return status;
}

static NDIS_STATUS ReadGlobalConfigurationEntry(NDIS_HANDLE cfg, const char *_name, PULONG pValue)
{
    NDIS_STATUS status;
    PNDIS_CONFIGURATION_PARAMETER pParam = NULL;
    NDIS_STRING name = {};
    const char *statusName;
    NDIS_PARAMETER_TYPE ParameterType = NdisParameterInteger;
    NdisInitializeString(&name, (PUCHAR)_name);
    NdisReadConfiguration(
        &status,
        &pParam,
        cfg,
        &name,
        ParameterType);
    if (status == NDIS_STATUS_SUCCESS)
    {
        *pValue = pParam->ParameterData.IntegerData;
        statusName = "value";
    }
    else
    {
        statusName = "nothing";
    }
    DPrintf(2, "[%s] %s read for %s - 0x%x\n", __FUNCTION__, statusName, _name, *pValue);
    if (name.Buffer) NdisFreeString(name);
    return status;
}

static void RetrieveDriverConfiguration()
{
    NDIS_CONFIGURATION_OBJECT co;
    NDIS_HANDLE cfg, params;
    NDIS_STATUS status;
    DEBUG_ENTRY(2);
    co.Header.Type = NDIS_OBJECT_TYPE_CONFIGURATION_OBJECT;
    co.Header.Revision = NDIS_CONFIGURATION_OBJECT_REVISION_1;
    co.Header.Size = NDIS_SIZEOF_CONFIGURATION_OBJECT_REVISION_1;
    co.Flags = 0;
    co.NdisHandle = DriverHandle;
    status = NdisOpenConfigurationEx(&co, &cfg);
    if (status == NDIS_STATUS_SUCCESS)
    {
        NDIS_STRING paramsName = {};
        NdisInitializeString(&paramsName, (PUCHAR)"Parameters");

        NdisOpenConfigurationKeyByName(&status, cfg, &paramsName, &params);
        if (status == NDIS_STATUS_SUCCESS)
        {
            ReadGlobalConfigurationEntry(params, "DisableMSI", &bDisableMSI);
            NdisCloseConfiguration(params);
        }
        NdisCloseConfiguration(cfg);
        if (paramsName.Buffer) NdisFreeString(paramsName);
    }
}

#if NDIS_SUPPORT_NDIS61
static NDIS_STATUS ParaNdis6x_DirectOidRequest(IN  NDIS_HANDLE miniportAdapterContext,  IN  PNDIS_OID_REQUEST OidRequest)
{
    NDIS_STATUS  status = NDIS_STATUS_NOT_SUPPORTED;
    PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)miniportAdapterContext;

    if (pContext->bSurprizeRemoved) status = NDIS_STATUS_NOT_ACCEPTED;

    DPrintf(1, "[%s] came %s\n", __FUNCTION__, ParaNdis_OidName(OidRequest->DATA.SET_INFORMATION.Oid));

    return status;
}

static VOID ParaNdis6x_CancelDirectOidRequest(IN  NDIS_HANDLE miniportAdapterContext,  IN  PVOID RequestId)
{
    UNREFERENCED_PARAMETER(miniportAdapterContext);
    UNREFERENCED_PARAMETER(RequestId);
}
#endif

/**********************************************************
Driver entry point:
Register miniport driver
Initialize WPP
Return value:
    status of driver registration
***********************************************************/
// this is for OACR

extern "C"
{
DRIVER_INITIALIZE DriverEntry;
}

NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject, PUNICODE_STRING pRegistryPath)
{
    NDIS_STATUS                             status = NDIS_STATUS_FAILURE;
    NDIS_MINIPORT_DRIVER_CHARACTERISTICS    chars;
#ifdef DEBUG_TIMING
    LARGE_INTEGER TickCount;
    LARGE_INTEGER SysTime;
#endif DEBUG_TIMING

#ifdef NETKVM_WPP_ENABLED
    // Initialize WPP Tracing
    WPP_INIT_TRACING(pDriverObject, pRegistryPath);
#else
    ParaNdis_DebugInitialize();
#endif

    DEBUG_ENTRY(0);
    DPrintf(0, __DATE__ " " __TIME__ "built %d.%d\n", NDIS_MINIPORT_MAJOR_VERSION, NDIS_MINIPORT_MINOR_VERSION);
#ifdef DEBUG_TIMING
    KeQueryTickCount(&TickCount);
    NdisGetCurrentSystemTime(&SysTime);
    DPrintf(0, ("\n%s>> CPU #%d, perf-counter %I64d, tick count %I64d, NDIS_sys_time %I64d\n", __FUNCTION__, KeGetCurrentProcessorNumber(), KeQueryPerformanceCounter(NULL).QuadPart,TickCount.QuadPart, SysTime.QuadPart));
#endif

    NdisZeroMemory(&chars, sizeof(chars));

    chars.Header.Type      = NDIS_OBJECT_TYPE_MINIPORT_DRIVER_CHARACTERISTICS;
    chars.Header.Revision  = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1;
    chars.Header.Size      = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1;
    chars.MajorNdisVersion = NDIS_MINIPORT_MAJOR_VERSION;
    chars.MinorNdisVersion = NDIS_MINIPORT_MINOR_VERSION;
    /* stupid thing, they are at least short */
    chars.MajorDriverVersion = (UCHAR)(PARANDIS_MAJOR_DRIVER_VERSION & 0xFF);
    chars.MinorDriverVersion = (UCHAR)(PARANDIS_MINOR_DRIVER_VERSION & 0xFF);

    // possible value for regular miniport NDIS_WDM_DRIVER - for USB or 1394
    // chars.Flags  = 0;

    chars.InitializeHandlerEx           = ParaNdis6_Initialize;
    chars.HaltHandlerEx                 = ParaNdis6_Halt;
    chars.UnloadHandler                 = ParaNdis6_Unload;
    chars.PauseHandler                  = ParaNdis6_Pause;
    chars.RestartHandler                = ParaNdis6_Restart;
    chars.OidRequestHandler             = ParaNdis6_OidRequest;
    chars.CancelOidRequestHandler       = ParaNdis6_OidCancelRequest;
    chars.SendNetBufferListsHandler     = ParaNdis6_SendNetBufferLists;
    chars.CancelSendHandler             = ParaNdis6_CancelSendNetBufferLists;
    chars.ReturnNetBufferListsHandler   = ParaNdis6_ReturnNetBufferLists;
    chars.CheckForHangHandlerEx         = ParaNdis6_CheckForHang;
    chars.ResetHandlerEx                = ParaNdis6_Reset;
    chars.ShutdownHandlerEx             = ParaNdis6_AdapterShutdown;
    chars.DevicePnPEventNotifyHandler   = ParaNdis6_DevicePnPEvent;
    chars.SetOptionsHandler             = ParaNdis6_SetOptions;

#if NDIS_SUPPORT_NDIS61
    chars.Header.Revision  = NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2;
    chars.Header.Size      = NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2;
    chars.DirectOidRequestHandler       = ParaNdis6x_DirectOidRequest;
    chars.CancelDirectOidRequestHandler = ParaNdis6x_CancelDirectOidRequest;
#endif

    status = NdisMRegisterMiniportDriver(
            pDriverObject,
            pRegistryPath,
            NULL,
            &chars,
            &DriverHandle);

    if (status == NDIS_STATUS_SUCCESS)
    {
        RetrieveDriverConfiguration();
        DEBUG_EXIT_STATUS(status ? 0 : 4, status);
    }
    else
    {
#ifdef NETKVM_WPP_ENABLED
        WPP_CLEANUP(pDriverObject);
#endif // WPP
    }
    return status;
}

VOID ParaNdis6_SendNBLInternal(NDIS_HANDLE miniportAdapterContext, PNET_BUFFER_LIST pNBL, NDIS_PORT_NUMBER portNumber, ULONG flags)
{
    ParaNdis6_SendNetBufferLists(miniportAdapterContext, pNBL, portNumber, flags);
}

redpajama_set_name: RedPajamaGithub


dnl Macros to check the presence of generic (non-typed) symbols.
dnl constitutes the Autoconf Macro.
CC_CHECK_CFLAGS_SILENT([$1]) dnl Don't execute actions here!
dnl the current linker to avoid undefined references in a shared object.
dnl We check $host for which systems to enable this for.
dnl use -Wl,-z,defs only for those platform not behaving this way.
dnl it does without going to look for what the heck -z defs does.
dnl constructs (like attributes) are not simply ignored.


Interested in attending Gerstner Sloan-Kettering Graduate School of Biomedical Sciences at Memorial Sloan-Kettering Cancer Center? REQUEST INFO!
The mission of the Gerstner Sloan-Kettering Graduate School of Biomedical Sciences is to advance the frontiers of knowledge by providing to gifted and creative students in an interactive innovative and collegial environment the education and training they need to make new discoveries in the biological sciences. Much of the recent explosion in new knowledge about normal biological functions and disease is rooted in fundamental laboratory discoveries. Contributions to our understanding of human disease including cancer have come from many disciplines -- genetics cell biology structural biology immunology and developmental biology among others. The prospects for designing new interventions utilizing the modern tools of cell and molecular biology are enormous. And the rules -- whether one is talking about infectious metabolic neurological diseases or cancer -- are the same: understand the disease process at the cellular level; identify the genes involved and their protein products; and focus on these molecules to prevent or reverse the disease with new drugs vaccines or other approaches. e are at the beginning of this journey harnessing our burgeoning new knowledge and bringing it from the laboratory into clinical practice. But we are only at the beginning. We need to train the next generation of scientists who are passionate about attacking problems in human disease through basic research. With an outstanding scientific faculty an acclaimed clinical faculty and ongoing basic science research linked to disease-relevant models the Gerstner Sloan-Kettering Graduate School of Biomedical Sciences is ideally positioned to offer this training. The scientific enterprise is wonderful and ennobling. It embodies a great adventure. We invite you to join us.


The president is wrong to scapegoat the intelligence agency for failing to connect the dots on the Christmas bomber. Former Bush speechwriter Marc Thiessen on why Obama's early moves tied our hands in the war on terror.
The report released by the White House Thursday into the failure to stop al Qaeda's attempt to blow up a passenger plane over Detroit found a number of mistakes were made-including the misspelling of Umar Farouk Abdulmutallab's name and the failure to put him on the no-fly list. But the ultimate failure was much larger. According to the New York Times, "The report concluded that the government's counterterrorism operations had been caught off guard by the sophistication and strength of a Qaeda cell in Yemen, where officials say the plot against the United States originated."
President Obama laid blame for this failure on the agency he has put under siege since his second day in office: the CIA. "This was not a failure to collect intelligence," he declared this week, "it was a failure to integrate and understand the intelligence we had .... That's not acceptable and I will not tolerate it." But the President's chief counterterrorism advisor, John Brennan, told a different story, acknowledging that we did not, in fact, have all the intelligence we needed: "We did have the information throughout the course of the summer and fall about ... plans to carry out attacks," Brennan said. "We had snippets of information .... We may have had a partial name. We might have had an indication of a Nigerian. But there was nothing that brought it all together."
The question is: why did we have nothing that brought all the "snippets" of information together? Because within 48 hours after taking office, President Obama eliminated the only tool that would allow the intelligence community to do so: the CIA program to interrogate senior terrorist leaders. Thanks to Obama, America no longer have the capability to detain and question the only individuals who know how the information fits together-the terrorists themselves.


text:
@interface MyCCSprite : CCSprite

-(void) goToLocation: (CGPoint*) location;

-(BOOL) doesCollideWithRect:(CGRect) rect;

@end


Pic One of Earth's biggest icebergs ever seen has been discovered by orbiting satellites. The huge freeze-blob was just carved out from Greenland's Jakobshavn Glacier, and slid into the ocean.
The iceberg was formed between August 14 and 16, and was caught on camera by one of the European Space Agency's Sentinel satellites, 2-A, which was launched in June. The satellite studies the entire Earth's surface once every ten days and will be joined by a twin to cut this time in half next year.
The iceberg is an estimated 12.5 square kilometers across and has a depth of around 1400 meters, meaning a volume of 17.5 cubic kilometers. That would equate to enough ice to bury the entire island of Manhattan under 300 metres of frozen water.
"Icebergs are often so large that they cannot float away easily," said ESA. "They remain, sometimes for years, stuck on the bottom in shallower areas of the fjord until they finally melt enough to disperse, break into pieces or are pushed out by icebergs coming up from behind."
The Jakobshavn glacier that birthed the 'berg is of particular interest to scientists, since it has become one of the fastest moving ice sheets on Greenland and appears to be speeding up. Since it largely consists of ice on land, any ice that floats off will contribute to sea level rises, unlike floating Arctic ice which lowers sea levels when it melts.


text:
Windows galore!
CES 2016, Day 3: HP, Netflix, Dell, Honor, and more!
Derek Kessler
CES officially opened today, and the show floor was absolutely packed with the latest and greatest wares from companies around the globe. Sure, a lot of the big announcements were yesterday, but that didn't stop anybody from rolling out even more new gadgets and services. This is CES, after all, and what's a day of CES without a bunch of new tech? 06 January
HP goes premium
Early in its tenure HP was a pioneering electronics manufacturer, but somewhere along the way they got lost. Well HP has been beating their way back to amazing products, and this year at CES rolled out several impressive new offerings. Take the HP Spectre x360, which got an optional quad HD OLED display panel, and the obscenely-thin HP EliteBook Folio. HP still makes commodity hardware, sure, but the path they've taken to the premium end of the spectrum is resulting in some really great products.
Hands-on with the 13-inch HP Spectre x360 with QHD OLED display
Hands-on with HP's impressively thin EliteBook Folio
Netflix Everywhere
As Netflix CEO Reed Hastings took to the stage in Las Vegas for the CES 2016 keynote, Netflix went live in 130 new countries, bringing the video streaming service to virtually every country in the world. Notable new additions for Netflix included Russia, India and South Korea.
Netflix comes to 130 countries, including India
Samsung Gear S2 Classic 18K rose gold and platinum hands-on
Samsung has expanded its line of Tizen smartwatches with new, shinier models aimed at female buyers. The new rose gold Gear S2 Classic comes with a white leather band, while the platinum model is bundled with a black leather strap.
Samsung introduces new rose gold and platinum Gear S2 smartwatches
Dell's insane new OLED monitor is only $5,000
Normally we wouldn't spend a lot of time talking about a monitor, but we'll make an exception for this one. Dell today announced a new 30-inch 4K UltraSharp monitor, and it's the first to pack OLED display technology. This brings a few benefits, including narrow bezels and a narrow body, but it's the picture itself that's the big story. OLED brings intense colors and near-infinite black levels to the party, plus a ridiculously-fast 0.1ms refresh rate.
Here is Dell's astonishing $5,000 UltraSharp 30-inch OLED monitor
Dell adds new 4K OLED, InfinityEdge and wireless monitors to its lineup
Fossil Q Grant and Q54 Pilot
Fossil has a multi-pronged approach to smartwatches — those with screens, and those without. The new Q Grant and Q54 Pilot land in the second camp: They look like "regular" mechanical watches, but have smartwatch-like features baked into the back.
These watches have mechanical movements and all of the style of the standard Grant and Pilot 54 watches from Fossil, but can also track your steps and alert you of notifications from your phone. A neat balance to strike if you're not all-in with the smartwatch trend just yet.
Hands-on with Fossil's Q Grant and Q54 Pilot
Alcatel OneTouch comes to Windows Mobile
The Fierce XL is coming to T-Mobile
We've already had Acer jump in on the premium end of Windows 10 Mobile, now Alcatel OneTouch is here to round out the bottom. Their Fierce XL is coming to T-Mobile, and while it's not the most beastly of phones, but at $140 it's damned impressive. We're looking at a 5.5-inch 720p display, Qualcomm Snapdragon 210 processor, and an 8MP camera all wrapped in a colorful cyan body. The lower end is where Windows Phones have seen the most success, and the Fierce XL is bringing Alcatel OneTouch's expertise in that market to the fore.
Alcatel OneTouch Fierce XL Windows 10 Mobile smartphone announced, coming to T-Mobile
Hands-on with the T-Mobile Alcatel OneTouch Fierce XL with Windows 10 Mobile
The Honor 5X is coming to America
$199 for a solid phone from Huawei's sub-brand
Huawei's Honor sub-brand hits the U.S. this year with the arrival of the Honor 5X, a new, affordable handset around the $199 mark that delivers capable smartphone hardware features like a 1080p display, a metal chassis and a 13-megapixel camera with LED flash. On the software side it's still packing Android 5.1 Lollipop, but the Honor 5X has a lot to offer in other areas.
Honor 5X hands-on
Razer's new ultrabook is thin but mighty
Plus a Thunderbolt 3 dock that brings desktop-class graphics to the party
Razer's a gaming company at it's core, so you'd be forgiven for being confused at first by the new Razer Blade. By all measures it's a pretty typical ultrabook (though with Razer-styling), but plug it into the Razer Core box with a Thunderbolt 3 cable and suddenly you've got desktop-class graphics power. Portability when you need it, a rocking gaming machine when you want it. Oh, and that Thunderbolt 3 cable? It also provides power to the laptop. We're finally at one cable to rule them all.
The full tour of the new Razer Blade Stealth 12.5-inch ultimate gaming Ultrabook
The Razer Core adds desktop-class graphics to Razer's slick new ultrabook
The everything else that is CES
CES is more than just smartphones and tablets and laptops and watches. It's put on by the Consumer Technology Association, after all. At CES you can find just about everything that takes an electrical current (and some things that don't). And more than any other electronics trade show, CES defines the trends that we can expect to see in the coming year. And this year, it's all about connecting every facet of your home to you.
CES 2016: The Toaster-Fridge Awakens—in 4K HDR
💳 > 🍎 💳
These cards beat Apple Card when buying iPhone 11
CES (2016)

redpajama_set_name: RedPajamaCommonCrawl


We are so happy to finally introduce you to our newest feature, the visualizer! From now on you'll be able to test your ideas, before generating your pet!
You will find the visualizer in the species enclosure. We have also made it possible to go directly from research to generating, as well as the visualizer.
Simply choose between mutations and colors, or get inspired by pressing the randomize buttons - to see what beautiful creatures you can generate.
Please stay on topic or you will be suspended from news posts, thank you!


Buy Sale For /Unit/Furnace/Equipment Oven Microwave Vegetables Belt System Microwave Microwave Electricity thawing - Shandong Microwave Machinery Co.,Ltd.
Shandong Microwave Machinery Co.,Ltd. offers a full range of Microwave thawing machine for microwave thawing applicationsSale For /Unit/Furnace/Equipment Oven Microwave Vegetables Belt System Microwave Microwave Electricity thawing. Shandong Microwave Machinery Co.,Ltd. will also custom design components for your needs Microwave thawing machine. Shandong Microwave Machinery Co.,Ltd. can supply products Microwave thawing machinefor operation at 915 MHz in a variety of Sale For /Unit/Furnace/Equipment Oven Microwave Vegetables Belt System Microwave Microwave Electricity thawing configurations.
Shandong Microwave Machinery Co.,Ltd. can also provide Sale For /Unit/Furnace/Equipment Oven Microwave Vegetables Belt System Microwave Microwave Electricity thawing for applications where the magnetron needs to be separate from the power supply and controls. Shandong Microwave Machinery Co.,Ltd. Microwave power levels from 10kW to 300kW are standard products.Microwave thawing machine can be used in defrosting frozen food,for example,beef meat,pork,fish,poultry,dairy product ,fruit & vegetable and others.
Shandong Microwave Machinery Co.,Ltd.is a Microwave thawing machine factory specializing in the production of Sale For /Unit/Furnace/Equipment Oven Microwave Vegetables Belt System Microwave Microwave Electricity thawing, scientific research,manufacturing,installation, commissioning.Shandong Microwave Machinery Co.,Ltd.can provide Microwave thawing machinecustomers with design and services of 1-2000 tons Sale For /Unit/Furnace/Equipment Oven Microwave Vegetables Belt System Microwave Microwave Electricity thawing. Shandong Microwave Machinery Co.,Ltd. have finished hundreds of successful projects Microwave thawing machineover the years: peanut oil, soybean oil, rapeseed oil, cottonseed oil, sunflower oil, sesame oil, animal oil,grape seed oil, acer truncatum oil, peony seed oil, walnut oil, hemp seed oil, pine oil, tea seed oil, papaya oil, milk thistle seed, and other special type Microwave thawing machineoil. Shandong Microwave Machinery Co.,Ltd. have independent import and export department. Shandong Microwave Machinery Co.,Ltd. Microwave thawing machineequipment has been successfully exported to more than ten countries: Russia, Australia, India, Afghanistan, Cameroon,and so on.
can dry and sterilize all kinds of vegetables,the medical herbs,and the effect is good.
1. fast heating, microwave directly heating the tea of the internal and external at the same time, do not need to preheat.Tea can be processed when starting working.While traditional, there must be a preheating process.
2, uniform heating, The tea are exposure to the electromagnetic waves produced by magnetron,no coke leaves, coke and unqualified.As for the traditional tea sterilizing,it is heated unevenly,influence the quality of the tea heavily.
3, sterilization, alcoholization: pick the tea, the production process, often have the possibility of secondary pollution, filming for the microwave, drying have the functions of sterilization, alcoholize and traditional craft equipment does not have this feature, microwave special for summer, autumn tea, remove an indication, is quite effective, this alcoholize function, other mechanical is irreplaceable.
4, the tea quality improvement: tea when filming for the microwave surface temperature is not high, does not need cooling at the time of the leaf, leaf changes little, colour and lustre is green hide, aroma loss, less dry even, at the same time due to moisture evaporation speed, easy to form porous, product with good water complex insoluble substance soluble in the tea.
5, to reduce the labor intensity, improve work efficiency. this equipment adopts automatic upper and lower feed, the operator simply press a button, monitor equipment operation condition and patrol filming for the fresh leaves of degree can, filming for the whole lead, dry only 1 or 2 people.And traditional editing, dry work labor strength, bad work environment, filming for the whole drying should be 5 to 6 people.
6, pollution-free, environmental protection equipment, By practice has proved that the filming for the microwave, drying equipment, production of tea, its shape, colour and lustre, rinsing fragrance and other factors.It is better than traditional production, has increased significantly in sterilization and shelf time, facilitate storage, is very popular with consumers in the market.Microwave tea, therefore, is a revolution in tea processing machinery and equipment, once again leap, is the tea makers, improve product quality to build brand, strengthen the market visibility and competitiveness, to create a pollution-free, environmental protection enterprises, etc, the preferred green production equipment.
advanced production equipment and a perfect after-sales service system.


ARKANSAS – As reported by the Arkansas Democrat Gazette: "A majority of Arkansas voters in 1996 and 2000 rejected lottery proposals that contained provisions authorizing casinos, too, provisions widely regarded as the biggest factor in the failures at the ballot boxes.
"Lt. Gov. Bill Halter's proposed amendment to authorize the General Assembly to create state lotteries doesn't mention casinos.
"But attorneys for its foes are trying to paint it as casino-prone as the Nov. 4 election draws nearer. The lack of a definition of 'state lotteries' opens a door to casino-style games and is a major problem, they maintain.
"The Halter camp portrays this stance as groundless in light of positions taken by the state Supreme Court in past cases.
"…Forty-two states have lotteries. Six have video lottery terminals in addition to the usual paper lottery tickets, according to Arkansas Advocates for Children and Families, which also opposes Halter's amendment.
"…Since 1874, the Arkansas Constitution has prohibited lotteries without defining what they are…"


By Ewan Mowat (pictured) of UEL member firm AC White Solicitors of Ayr.
If you have ever had a takeaway delivered or organised a private cab lift to the airport, you will have touched the gig economy.
services. Music roadies are part of the gig economy Just as rock musicians are paid for the concerts they perform in and no more, so an army of temporarily employed, powered by social media and downloadable apps, have met a new demand for more convenience and easy assistance.
There are justifiable concerns about the vulnerability of workers in this booming sector. This is part of a broader concern about the erosion of the working rights of individuals and their ability to enforce those rights. With this in mind, we can be heartened by the recent ruling of the Supreme Court over the abolition of Employment Tribunal fees. While this is a profound decision with its impact still being assessed, at its heart it is a victory for fairness in society. And it comes in time to confront many of the abuses that might be emerging in the gig economy. This can only be good news.
The Supreme Court judgment has restated the importance of access of justice as a fundamental cornerstone of our law. This decision has given everyone who believes in fairness and access to justice a genuine boost. We also see this judgment has implications, of course, in other spheres. For example, access to justice remains a live issue in the Brexit debate, in terms of the rights of EU citizens and how they exercise them post Brexit.
The Employment Tribunal fees case, however, also highlights the renewed influence of trade unions within the industrial landscape, embattled as they have been recently, particularly with the passing of the Trade Union Act 2016. It was Unison who kept on fighting the tribunal fees case, despite defeats in the lower courts, before eventually winning in the UK Supreme Court. They will feel emboldened by this success. As we now know, the Employment Tribunal fee regime resulted in a significant decrease in the number of claims coming forward. Many potential claimants with valid claims lost out.
The reduced risk of claims also indirectly encouraged some employers to disregard their legal obligations, reasonably confident that they would get away with it. Unison's victory is not only a victory for employees. It is a victory for employers that comply with the law. Ultimately, this is a legal rather than a political victory. While politicians of different parties have, in recent years, spoken out against the Employment Tribunal fee regime, it was the Supreme Court that abolished it. We will be watching with renewed interest how our employment law landscape is moulded over the next few years. It is likely to be critical for individuals and employers. Enjoy the gig.


text:
WASP-17 é uma estrela de classe F na constelação de Scorpius, com uma magnitude aparente visual de 11,5. De acordo com dados de paralaxe, do terceiro lançamento do catálogo Gaia, está localizada a uma distância de aproximadamente 1 320 anos-luz (400 parsecs) da Terra. Em 2009, foi descoberto um planeta extrassolar Júpiter quente por trânsito em uma órbita retrógrada ao redor da estrela.

Características

WASP-17 já foi classificada com um tipo espectral de F6 ou F4, e é uma estrela evoluída mais brilhante que uma típica estrela da sequência principal. Modelos evolucionários indicam que esta estrela tem uma massa de aproximadamente 1,29 vezes a massa solar e expandiu-se para um raio 1,58 vezes superior ao raio solar, com uma idade de 2,7 bilhões de anos. A temperatura efetiva de sua fotosfera já foi estimada entre 6 500 e 6 650 K, dando à estrela a coloração branco-amarela típica de estrelas de classe F. A metalicidade de WASP-17 parece ser um pouco menor que a solar, com estimativas de sua abundância de ferro variando entre 56% da solar ([Fe/H] = -0,25) e 95% da solar (Fe/H] = -0,02). Sua velocidade de rotação projetada, determinada diretamente da observação do trânsito do planeta, é de 10 km/s.

Sistema planetário

Em 2009, foi descoberto pelo projeto SuperWASP um planeta extrassolar em trânsito orbitando esta estrela, denominado WASP-17b. Sua órbita tem um período curto de 3,735 dias e está inclinada em 86,7° em relação ao plano do céu. Inicialmente, os dados indicavam uma excentricidade orbital considerável de 0,13, mas observações mais recentes mostraram que a órbita é circular.

Esse planeta é um Júpiter quente com uma massa de 48% da massa de Júpiter a uma distância de apenas 0,051 UA da estrela. O trânsito do planeta tem duração de 4,3 horas e apresenta uma curva de luz bastante profunda, com uma diminuição de 1,7% no brilho total da estrela. Isso indica que o planeta é muito grande, com um raio de 1,93 vezes o raio de Júpiter, correspondendo a uma baixa densidade de 0,08 g/cm3. Em 2012, ele era o maior planeta conhecido. Esse fenômeno de inflação no raio planetário devido à alta irradiação estelar é observado em vários Júpiteres quentes, principalmente em torno de estrelas quentes de classe F, e permanece um desafio aos modelos teóricos de física planetária.

Observações infravermelhas a 4,5 e 8 µm pelo Telescópio Espacial Spitzer detectaram diminuição de 0,2% no brilho do sistema durante o eclipse secundário, quando o planeta passa atrás da estrela. Isso indica que o planeta é quente e emite energia termal significativa, com uma temperatura efetiva estimada em 1881 ± 50 e 1580 ± 150 K pela emissão a 4,5 e 8 µm respectivamente. Esses valores são consistentes com um baixo albedo e uma eficiente recirculação de energia entre o lado iluminado e o escuro do planeta, já que sua temperatura de equilíbrio calculada para essas condições é de 1771 ± 35 K.

Quando um planeta passa na frente de uma estrela em rotação, ele bloqueia parte da luz da estrela se afastando e se aproximando do observador, causando uma aparente mudança na velocidade radial da estrela durante o trânsito. Esse fenômeno, conhecido como efeito Rossiter–McLaughlin, foi usado para mostrar que WASP-17b orbita sua estrela de forma retrógrada, na direção oposta à de rotação estelar, com um ângulo de cerca de 150° entre o plano da órbita e o eixo de rotação estelar. Isso significa que o planeta provavelmente evoluiu para sua posição atual por interações gravitacionais com um segundo planeta ou estrela no sistema. Acredita-se que todos os Júpiteres quentes foram originalmente formados distantes de suas estrelas, depois da linha do gelo, e migraram para perto por algum tipo de interação com o gás ou poeira circunstelar ou outros objetos.

Observações espectroscópicas do trânsito em diferentes comprimentos de onda permitem explorar a composição atmosférica de um planeta, já que o raio do planeta parecerá maior em regiões do espectro em que a opacidade atmosférica é aumentada devido à absorção da luz estelar por um certo componente químico. Essa técnica, chamada de espectroscopia de transmissão, foi usada em diversos estudos para detectar sódio (Na), água (H2O), e potássio (K) na atmosfera de WASP-17b. As intensas linhas de absorção desses componentes indicam que a atmosfera do planeta não possui cobertura significativa de nuvens ou névoa.

Ligações externas

WASP-17 b The Extrasolar Planets Encyclopaedia
WASP-17 b Exoplanet Data Explorer

Estrelas de classe F da sequência principal
Constelação de Scorpius
Sistemas planetários
Variáveis de trânsito planetário

redpajama_set_name: RedPajamaWikipedia


text:
cmt(Rohrmeier, Kerry) » Refine Search
Seasonal road layout design in mountainous terrain using GIS with the side hill and least cost path methods
by Brundage, Emil H., M.A. San Jose State University. 2015: 51 pages; 10011677.
Searching for Greener Grass: The Experiences of African-American Educators Who Left High-poverty, High-minority Schools for Employment in Middle- and Upper-class Suburban Schools
by Young, Natalie, Ed.D. Northern Illinois University. 2018: 185 pages; 10831021.
The value of internships within athletic training education: Educators' views
by Landry Shirley, Heather Arlene, Ph.D. The University of Mississippi. 2015: 277 pages; 3726956.
The Psalter Mappaemundi: Medieval Maps Enabling Ascension of the Soul Within Christian Devotional Practices
by Muir, Autumn M., M.A. Bowling Green State University. 2011: 74 pages; 10817838.
Grand Canyon Projectile Points and Human Population Change
by Keltz, Ehren D., M.A. Northern Arizona University. 2019: 204 pages; 13882750.
Tie-Dyed Realities in a Monochromatic World: Deconstructing the Effects of Racial Microaggressions on Black-White Multiracial University Students
by Touchstone, Claire Anne, Ed.D. Loyola Marymount University. 2013: 431 pages; 3610321.
Full Text - PDF (3 MB)
A multigroup analysis of reintegrative shaming theory: An application to drunk driving offenses
by Dansie, Elizabeth J., Ph.D. Utah State University. 2011: 182 pages; 3440429.
Leadership Development: The Effects of Service-Learning Programs on Adult Learners' Success
by Martin, Richenel M., Jr., D.E.Lead. University of Charleston - Beckley. 2019: 160 pages; 13885626.
Pennsylvania Community College Students Interested in Earning Baccalaureate Degrees: A Qualitative Analysis of Their Decision-Making Experiences
by Fetterolf, Annette M., D.Ed. Indiana University of Pennsylvania. 2018: 215 pages; 10840335.
Full Text - PDF (875 KB)
Grizzly bear and human interaction in Yellowstone National Park, Bear Management Areas
by Coleman, Tyler Hardy, Ph.D. Montana State University. 2012: 171 pages; 3547178.
Lithic scavengers: An analysis of lithic recycling behavior in the Archaic Owyhee Desert of Nevada
by Yaquinto, Brian P., M.A. Northern Arizona University. 2012: 221 pages; 1511529.
Dimensionality, reliability and validity of a measure of combat experience
by Guyker, Wendy M., Ph.D. State University of New York at Buffalo. 2010: 50 pages; 3423567.
The molecular determinants of tumor cell sensitivity and resistance to antibody-dependent cellular cytotoxicity (ADCC)
by Murray, Joseph C., Ph.D. Georgetown University. 2013: 160 pages; 3588240.
Mobility and lithic reduction strategies during the Archaic and Basketmaker periods in northwestern New Mexico
by Flavin, Kasey M., M.A. Northern Arizona University. 2015: 246 pages; 1594003.
Christian Diet Books: Thinning, Not Sinning
by Allen, Susanne Bostick, M.A. The George Washington University. 2016: 78 pages; 10118622.
Life goals and eating disorders among adolescent girls in Birmingham, Alabama
by Smith, Carolyn E., M.A. The University of Alabama. 2011: 108 pages; 1505249.
Beyond the "bubble:" Study abroad and the psychosocial and career development of undergraduates
by Chapman, Vera V., Ph.D. The University of Mississippi. 2011: 353 pages; 3461273.
An Examination of Variation in Function Among Early Paleoindian Weapon Systems on the Plains
by Snyder, Brian J., M.A. Northern Arizona University. 2017: 177 pages; 10275711.
Searching for communities of practice with sherds: Stylistic variation in the Cibola region
by Newcomb, Elizabeth Blair, M.A. Northern Arizona University. 2015: 110 pages; 1598389.
Food Is a Right: Student Perceptions of College Food Access Programming at a California State University
by Aceves, Esperanza Monica, M.A. California State University, Long Beach. 2018: 149 pages; 10839607.
Power, trust, police unions, and police managers: A quantitative research study
by Lima, Julio L., Ph.D. Capella University. 2015: 105 pages; 3732850.
Relationship of organizational work climate to nurse turnover in operating room settings
by Jay, Rita A., Ph.D. Capella University. 2015: 251 pages; 3724927.
"Your guess is as good as mine": Exploring public interpretation through applied archaeology
by Welch, Stephanie M., M.A. Northern Arizona University. 2014: 121 pages; 1571872.
Climate change and its impact on the Iñupiat of Point Lay, Alaska: A case study of resilience
by Beauparlant, Alain Marcel, M.A. University of Alaska Anchorage. 2014: 254 pages; 1563534.
The relationship between informed consent presentation styles and participants' comprehension in clinical research
by Beasley, Amanda L., Ph.D. Capella University. 2015: 102 pages; 3706503.
In vitro and in vivo comparison of the pathogenicity of four influenza virus strains
by Hurst, Brett L., M.S. Utah State University. 2012: 319 pages; 1510094.
Exploring the Strategies for Accessing Microloans Used by Small and Medium Enterprises
by Kashim Olanrewaju, Abdul Rashid, Ph.D. Walden University. 2018: 146 pages; 10827249.
Mapping upward mobility for residents of a mixed-income housing project in Salishan, WA
by Boyde, Natasha P., M.A. California State University, Long Beach. 2016: 136 pages; 10014958.
The Archaic journey: Mobility and resource use on the Dixie National Forest
by Weder, Maia, M.A. Northern Arizona University. 2014: 148 pages; 1556629.
Are delay discounting, probability discounting, time perception, and time perspective related? A cross -cultural study among Latino and White American students
by Neves, Ana Amelia L., Ph.D. Utah State University. 2009: 206 pages; 3352457.


text:
The Optimist's Take: Playing Time For Arthur Moats
The Pittsburgh Steelers have, by and large, been on an upward swing over the course of the past two and a half seasons after they missed the playoffs for two straight seasons, and failed to win a postseason game in four straight years.
Last season saw them gain that elusive playoff victory, though they came up short with about three minutes left in the Divisional round a week later. Their offense took off, and their defense improved, showing playmaking ability and opportunism.
But there are still a lot of unanswered questions facing the team as we crack into free agency territory. As an exercise, we like to take a stab at some of those questions, presenting arguments for the pros and cons of each side of the coin. This is the optimist's take on the following question.
Question: What, and how significant, will Arthur Moats' role be this season?
When the Steelers first signed Arthur Moats, he came from the Bills on a one-year, veteran-minimum contract as a player who was believed to have position flexibility to play both inside linebacker and outside linebacker, considering the way he was used in Buffalo.
Since he has been with the Steelers, however, he has been almost solely used as an outside linebacker, although if I recall correctly, he did see a few snaps inside during the preseason when injuries were an issue. But more importantly, he opened the 2015 season as the team's starting left outside linebacker.
Of course, Moats logged several starts for the Steelers on the right side after Jarvis Jones suffered an injury that wiped out most of his season, and at that time he rotated heavily with James Harrison.
But Moats lost his starting position to Bud Dupree late in the season, even if the distinction was largely nominal. In fact, Dupree was fairly regularly seeing more snaps than Moats while the latter was starting, and vice versa in the opposite scenario.
Dupree is expected to take on a greater volume of the snaps in his second season, but it might still be a tall task to ask him to carry out a full slate of snaps on a 16-game schedule, as his game is still being refined, and he showed fatigue due to workload late last year.
Considering Harrison's likely lessened workload this season, provided that he does indeed return, it would also not surprise if the Steelers utilize Moats' position flexibility, given that he can rush from both the left and the right side, as he gains some snaps spelling Jones that he might lose from Dupree taking a higher proportion of snaps.
Moats is not a Pro Bowl player, but he is a fairly productive one when he is on the field, and he has recorded four sacks in each of the past two seasons in a heavy rotation. He is disciplined and has the size to play the run, so there is certainly no compelling reason for the coaching staff to want to keep him on the sideline. Who knows, perhaps they will even consider allowing him to serve as a backup inside linebacker as well, considering that they lost two from their interior depth chart.
Most importantly, if there is an injury, or somebody is struggling, the Steelers already know and trust that Moats would be able to step into the lineup and do a representative job. The team let him know his value when they extended him a three-year contract after his initial one-year deal with the team was up, and it showed their respect for what he can offer them.
Related Items:Arthur Moats, Bud Dupree, James Harrison, Jarvis Jones, Steelers
Arthur Moats: Steelers Still 'Another Year Or Two Away' From Competing With Top Teams
Arthur Moats Explains Why George Pickens Is Young Steelers Star Most Likely To Become Elite
Kenny Pickett 'Absolutely' Can Make Every Throw Joe Burrow Does, Arthur Moats Says


Summer is here, which means it's time to hit the pool and beach! When I lived in NYC, we loved going to Rockaway Beach. I sure miss that place. If I wasn't living halfway across the country these days, I'd be there this weekend, no doubt!
Now that we're in Dallas without a coast in sight, my husband and I are all about the pool. I think we spent every weekend at our apartment building's pool last summer. It was the perfect way to beat the Texas heat!
I can't hit the pool without some fun, but affordable beach accessories. Which means that it's time for the next edition of my Faves Under $50 series! Each month, I'm sharing my favorite finds under $50 for everything from clothes to home decor.
To celebrate all things summer, this month I'm sharing the must have under $50 pool and beach accessories!
Gone are the days when my husband and I would head to pool with only a towel. These days, we're all about comfort and cool beach accessories.
With that in mind, I've rounded up the must have beach accessories.
I'm sharing everything from cute pool floats to luxurious Turkish towels … all at an awesome price!
Are you ready for some great deals?
When it comes to beach accessories for women, it all starts with the perfect swimsuit and cover up, right?
Here are some of my faves, and if you're looking for something cute to go with your bathing suit, make sure to check out my roundup of summer accessories under $50, too!
Crochet Mix Cover Up Dress – Love the pretty aqua color and cute crochet detail on the sides. Also comes in white and black.
Patterned Woven Caftan Swim Cover Up – Such a fun print and the shape is easy and flattering. Also comes in a cute black and white print.
Long Sleeve Striped Knit Cover Up – Cute enough to wear it to the beach then out to dinner after.
Dip-Dyed Kimono Cover Up – The dip-dye is such a unique touch and the tassels are so fun!
Lace Trim Ruana – This open front cover up is so chic, plus it's perfect for hot days.
Maxi Kaftan – Such a fun, colorful style … love the tassels and sheer fabric! Also comes in black and floral print.
Stappy Back Swimsuit – Love the unique strap detail, and the ruching on the front is so flattering. Comes in 4 colors.
High Neck Strappy Back Swimsuit – The trendy high neck on this suit keeps you covered … perfect for chasing kids or for women with larger busts! Love the strappy back detail, too.
Tiered Tankini Top – Cute and flattering ruffled top that can be paired with different bottoms. Comes in 4 colors, including black.
Patterned Midkini Top and Bottom – Such a fun a print on this suit, but the best part is that available in bra sizes and goes up to DDD!
Blue Racerback Top and Bottom – Love the vibrant blue color, cute bra cup detail, and flattering ruching on the bottom, PLUS it comes in bra cup sizes up to DDD.
Scallop V-Neck One Piece – The scallop neck (and back) is such a fun, trendy touch on an otherwise classic suit.
Wrap Bikini Top and Bottom – The wrap detail and pattern are fun and flirty, plus it comes in bra cup sizes up to DDD!
My favorite summer beach accessories are always chic bags and hats, perfecting for hauling all your stuff and protecting your face from the sun!
Black Striped Canvas Tote – Love the stripes and tassel details, plus there are lots of pockets to keep everything organized. Comes in 4 colors.
Pink Striped Tote Bag – Huge and the stripes are so fun. Also comes in green.
Pom Pom Straw Tote – How cute are those pom poms? Such a fun bag!
Large Cotton Beach Tote – This cheap bag (under $20!) comes in a bunch of patterns and colors and has tons of pockets to store all your stuff.
Lemon Cooler Bag – So cute! I have the watermelon version of this bag, and we love it … it gets tons of compliments. Note: this bag has seams, so it's not 100% waterproof. Use ice packs instead of loose ice to avoid leaking.
Adjustable Short Brim Fedora – Cute and easy to wear! Available in tons of colors.
Cursive Embroidered Hat – The perfect cheeky beach accessory! Comes in 17 different saying options.
Adjustable Panama Hat – Such a classic … I love the patterned band. Comes in 5 different band options.
No pool day is complete without a beach towel. I like to use something cute.
Round Terry Towel – This pretty towel would make a fun beach mat or unique towel. Comes in 8 patterns and colors.
Striped Turkish Towels – These towels are thin, absorbent, and come in lots of fun colors.
Flamingo Beach Towel – Such a cute pattern! Use it as a beach mat or oversized towel.
Microfiber Beach Towels – Love the bright colors, and they come with a bag to keep you organized, too. There's also a round version you could use as a beach mat.
Pool Floats are pretty much the trendiest pool and beach accessory around!
And here are a few more affordable beach accessories to round out the list!
Pineapple Chiller – Such a fun way to keep your drink cold! Love the Coconut and Tiki options, too!
Donut Pool Drink Floats – Keep your drink close by with these adorable holders. The Floatmingo option is also super cute!
Beach Smartphone Speaker – Amplify your tunes with this awesome retro-style speaker!
Beach Umbrella – My husband and I have this exact umbrella, and we love it. It's perfect for pale people who love the beach, and it tilts so you can adjust it as the sun moves across the sky. Make sure to get a sand anchor, too.
Beach Chairs – I have chairs very similar to these (which come in multiple colors), and I love them. They sit very low, so you can dip your toes in the sand.
Need something fun to take to the beach? Make sure to check out my DIY Yard Games post. And don't worry, if you don't want to DIY, I've included games you can buy, too!
What are your must have beach accessories?
P.S. Check out my whole Faves Under $50 Series here for more fun, affordable ideas!
I wish I had a pool, just so I could buy one of those cute pool floats!


Experience a true "A Mountain Lodge" in the Smoky Mountains of Tennessee! This 5 bedroom cabin boasts great amenities to make your stay unforgettable: resort pool access, pool table, fireplace, hot tub, barbecue grill on a covered deck, wireless Internet access, and more!
Your group cabin rental is located in Mountain Park Resort less than a mile off the Parkway in Pigeon Forge, TN. Dollywood, The Comedy Barn, outlet shopping, gourmet restaurants, and the Dixie Stampede dinner show are all within reach! When you book a convenient cabin in the Smokies, you can expect an even better stay with your family, friends, or group!
Standing apart from other Smoky Mountains cabin rentals, every bedroom in this cabin rental contains a king-sized bed, giving every guest the chance to enjoy the luxury of an expansive, comfortable bed. In addition to king-size beds, each bedroom features private access to a full bath.
Whether you're visiting the Smokies for a family reunion, church group getaway, or business retreat, this vacation rental, which sleeps 14, and the other available cabin rentals in Mountain Park Resort can be rented out to accommodate even larger parties.
There's plenty of fun to be had at your cabin as well! Your family or group is bound to love having resort pool access on their cabin vacation! On warm summer days in the Smoky Mountains, spend some time catching some rays and splashing in the seasonal outdoor swimming area. In the winter months, you can still enjoy the soothing waters of your cabin's outdoor hot tub on a covered deck. Rest your weary bones and take in your beautiful Smoky Mountain scenery in a lovely resort setting.
When you book "A Mountain Lodge" online with Cabins USA Gatlinburg, not only are you reserving a terrific group cabin, but you'll also earn our cabin discount! Check this cabin's availability by booking now to see how much you'll save on your vacation in the Tennessee Smoky Mountains!


How does one identify what it means to be an "authentic Christian witness"? What does the author hope for us to identify as ways to approach and follow the teaching of the Church? What does the author mean by "communal"? What are Catholics doing already to live the communal? How do we address the challenges noted in the paragraph?
The Extraordinary General Assembly of the Synod of Bishops is the third of this category. One might say this is the first synod with such wide interest, international participation in the initial stages and hope for good work going forward.
"The Pastoral Challenges of the Family" is based on the feedback and analysis requested from the national various Conferences of Bishops around the world late in 2013. So, besides the questionnaire, the document also incorporates the concerns of those who sent their reflections directly to the Pontifical Council for the family with the appropriate theological reflection. This is the first Synod for Lorenzo Cardinal Baldisseri.
The Holy Father has placed the work of the Synod under the patronage of the Holy Family. The Synodal prayer concludes the instrumentum labors.
Pope Francis, our Holy Father, has called for an Extraordinary Meeting of the Synod of Bishops to discuss the Pastoral Challenges to the Family in the Context of Evangelization.
In preparation for the Extraordinary Synod of 2014, the Pope has requested widespread support from the laity through their input on challenges facing families within the context of faith.
Before completing the questionnaire, please read this Preparatory Document that includes a beautiful description of Marriage and Family.
Part I of II of the transcript of the interchange between Pope Francis and the journalists on Sunday's plane ride to Rome. His Holiness gave journalists an unprecedented, unscripted and and frank responses to their questions. The news people went overboard with the some aspects of the interview, but that's no surprise for a bunch of people working with churchmen is new. The constant talk about homosexuality is bit much as of now; there is more people want to know of what the Holy Father thinks.
We Catholics follow Jesus Christ, not a bureaucrat, or an organization. Please remember that.
Then, the organization of the Day, not something specific, but everything: the artistic part, the religious part, the catechetical part, the liturgical part … it was very beautiful! They have a capacity to express themselves in art. Yesterday, for instance, they did very beautiful things, very beautiful! Then, Aparecida. For me Aparecida is an intense religious experience. I recall the Fifth Conference. I was there to pray. I wanted to go alone, somewhat hidden, but there was an impressive crowd! It wasn't possible [to be hidden], I knew that before arriving. And we prayed, we did. I don't know … one thing … but also from your part. Your work was, I'm told – I didn't read the newspapers during these days, I didn't have the time, I did not watch the TV, nothing –, but I'm told that it was good, good, good work! Thank you, thank you for the collaboration, and thank you for having done this. Then the number, the number of young people. Today – I can't believe it – but today the Governor spoke of three million. I can't believe it. But from the altar — that's true! – I don't know if you, some of you were at the altar: from the altar, at the end, the whole beach was full, up to the curve, more than four kilometers. But so many young people. And they say, Monsignor [Archbishop] Tempesta told me, that they were from 178 countries: 178! The Vice-President also gave me this number: that's certain. It's important! Intense!
The steps I have taken in these four and a half months, come from two sources: the content of what had to be done, it all comes from the source of the General Congregations that we Cardinals had. They were things that we Cardinals asked for to the one who'd be the new Pope. I remember that I asked for many things, thinking of someone else. That is, we asked, this has to be done … for instance, the Commission of eight Cardinals, we know that it's important to have an outside consultation, not the consultations that take place, but from the outside. And this is in line – here I make a sort of abstraction, thinking, however, to explain it – in the line increasingly of the maturation of the relation between the Synodality and the Primacy. That is, these eight Cardinals favor Synodality, they help the different episcopates of the world to express themselves in the government itself of the Church. Many proposals were made, which have not yet been put into practice, such as the reform of the Synod's Secretariat, the methodology; such as the Post-Synodal Commission which has a permanent character of consultation; such as the Cardinals' Consistories with topics that aren't so formal – such as, for instance, canonization –, but also subjects, etc. Well, the source of the contents comes from there. The second source is the opportunity. I'll tell you, it wasn't hard for me, at the end of the first month of pontificate, to create the Commission of the eight Cardinals, which is one thing … The financial part I thought I'd address next year, because it's not the most important thing to address. However, the agenda was changed due to the circumstances that you know, which are of the public domain; problems appeared which had to be addressed. The first, the problem of the IOR, namely, how to direct it, how to delineate it, how to reform it, how to heal what has to be healed, and there is the first Commission of Reference, that's its name. You know the <chirograph>, what is requested, those who make it up, and everything. Then we had the meeting of the Commission of the fifteen Cardinals who are concerned with the economic aspects of the Holy See. They are from all parts of the world. And there, while preparing that meeting, the need was seen to establish a same Reference Commission for the whole economy of the Holy See. That is, the economic problem was addressed outside the agenda, but these things happen when in the office of government, no? One goes here but a goal is kicked from over there and one must intercept it, isn't that right? Then, life is like this and that is what is lovely about life also. I repeat the question you asked me about the IOR, sorry, I'm speaking in Spanish. Sorry … the answer came to me in Spanish.


text:
Q: Backbone.js and Handlebars - Using grunt-contrib-handlebars I'm just wondering if anyone has had experience using this plugin in a backbone project.
Instead of having all my script template tags in a single index file, I wanted to house my templates in the same directory as my views that required them.
So I was hoping i could use the node option to require the local template and render to it and then append to an #id on my index file (which I'll sort out laster).
So basically I have my handlebars template (template.hbs) and its compiled js (template.js) alongside my backbone view, index.coffee.
public
   |_ coffee
      |_views
        |_card
           |_list
              index.coffee
              template.hbs
              template.js

Just as a reference, my grunt file looks like this:
handlebars: {
      compile: {
        options: {
          namespace: 'MyApp.Templates',
          node: true
        },
        files: {
          "public/coffee/views/card/list/template.js": "public/coffee/views/card/list/template.hbs"
        }
      }
    },

In my backbone view (index.coffee) I was hoping to require the handlebars template like so:
class CardList extends Backbone.View
    template: require('./template')

    …
    do some other shiz
    …

render: =>
    template = Handlebars.compile($(this.template).html())
    html = template
        model: this.model
    $(this.el).html(html)

Rendering this is spitting out this error in the inspector:
Uncaught [object Object]

> template = handlebars.compile($(this.template).html());

I obviously dont know what I'm doing, so I'm hoping someone could shed some light on how I can use this plugin properly.
I'm using grunt-contrib-handlebars v0.3.5
Any help is appreciated.
Thanks

A: You might be able to achieve that by building the files object dynamically.
Maybe something like this, although I'm not sure if cwd supports globbing patterns. I'm also not sure if dest is relative to cwd. If this is not the case, this will not work, but it's worth a shot.
handlebars: {
  dist: {
    options: {
      namespace: 'MyApp.Templates',
      node: true
    },
    // Glob for a directory of files, builds the files object, then map each
    // one to a new destination file.
    expand: true,
    cwd: './public/coffee/views/*',
    src: '**/*.hbs',
    dest: './',
    ext: '.js'
  }
},

A: Look inside your template.js file that you're including.  grunt-comtrib-handlbars should have precompiled it into a Javascript function for you, so there's no need to call Handlebars.compile anymore.  You could just remove that template = Handlebars.compile line.

redpajama_set_name: RedPajamaStackExchange


Jamaica Constable Force. I have a application form where can I drop it off? . Ingrid Smith Is the jamaica constabulary force recruiting district constables now. RECRUITMENT OF DISTRICT CONSTABLES – PROTECTIVE SERVICES DIVISION The The application form is available on the Jamaica Constabulary Force. Jamaica Constabulary Force·Sábado, 19 de diciembre de District Constable Requirement Checklist I have a application form where can I drop it off?.
Each constablle must pass a physical and medical examination as stipulated by Medical Services Branch of the Jamaica Constabulary Force. The applicants who have passed the interview will be required to do a medical examination, blood test and physical test.
Height and weight normally required are: Application forms may be found on the Jamaica Constabulary Force's website, or at any of the four recruitment centres islandwide. Applicants Must have clean records. Question failure to close gaps in life such as period of absence from school, gaps between employment, residence aboard and failure to complete academic programmes. The United District Constables Association. Applicants with CXC passes or its equivalent will be given priority consideration.
No academic examination passes are required. Probe details of information on application form, conduct further security and antecedent checks where necessary, seek verification and probe inconsistencies between antecedent findings and application data. Final application results of exam, medical, antecedent, criminal and security checks and interview will determine final score. Finding jobs for Jamaicans Consulting Agency. Minimum Height and Weight Requirement: Website of the Jamaica Constabulary Force.
Jamaican Jobs Online Regional Website. Jamaican jobs worldwide Internet Company. Must have two 2 recommendations from any of the following persons: Think Flawless Makeup Artist.
Recruitment The Constitution of U. The Protective Services Division is inviting applications from suitably qualified members of the public within the Corporate Area and St.
Powered by Create your own unique website with customizable templates. A District Constables Act. Sections of this page. The applicant must have a school leaving certificate. Job Hunt Jamaica Company. Seek explanation for multiple addresses, frequent change of telephone numbers and email addresses. Males 5 feet 5 inches and pounds. Females 5 feet 3 inches and pounds. English Language is compulsory.
Interested persons are jff submit their applications to the Protective Services Division, 3a Ruthven Road, Cnostable The application form is available on the Jamaica Constabulary Force Website at www.
Email or Phone Password Forgot account? Successful applicants in the tests will be interviewed by an interview panel. Catherine to be trained as members of the Rural Police District Constables.
As a requirement, candidates should have Mathematics or any other numeric based subjects such as Accounts, Chemistry and Physics.


Impala Black is a uniform stone which is used both for interior and exterior purposes like flooring, cladding, counters, etc.
Impala Black is a uniform stone which is used both for interior and exterior purposes like flooring, cladding, counters, etc. It is a black grey, fine to medium grained, vein cut dark plutonic rock consisting of plagioclase with other dark minerals. Water absorption in weightis 0.11%.