• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FreeItem函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FreeItem函数的典型用法代码示例。如果您正苦于以下问题:C++ FreeItem函数的具体用法?C++ FreeItem怎么用?C++ FreeItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了FreeItem函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CompareProductName

NTSTATUS
CompareProductName(
    IN HANDLE hSubKey,
    IN LPWSTR PnpName,
    IN ULONG ProductNameSize,
    OUT LPWSTR ProductName)
{
    PKEY_VALUE_PARTIAL_INFORMATION PartialInformation;
    UNICODE_STRING DriverDescName = RTL_CONSTANT_STRING(L"DriverDesc");
    UNICODE_STRING MatchingDeviceIdName = RTL_CONSTANT_STRING(L"MatchingDeviceId");
    ULONG Length;
    LPWSTR DeviceName;

    /* read MatchingDeviceId value */
    PartialInformation = ReadKeyValue(hSubKey, &MatchingDeviceIdName);

    if (!PartialInformation)
        return STATUS_UNSUCCESSFUL;


    /* extract last '&' */
    DeviceName = wcsrchr((LPWSTR)PartialInformation->Data, L'&');
    ASSERT(DeviceName);
    /* terminate it */
    DeviceName[0] = L'\0';

    Length = wcslen((LPWSTR)PartialInformation->Data);

    DPRINT("DeviceName %S PnpName %S Length %u\n", (LPWSTR)PartialInformation->Data, PnpName, Length);

    if (_wcsnicmp((LPWSTR)PartialInformation->Data, &PnpName[4], Length))
    {
        FreeItem(PartialInformation);
        return STATUS_NO_MATCH;
    }

    /* free buffer */
    FreeItem(PartialInformation);

    /* read DriverDescName value */
    PartialInformation = ReadKeyValue(hSubKey, &DriverDescName);

    if (!PartialInformation)
    {
        /* failed to read driver desc key */
        return STATUS_UNSUCCESSFUL;
    }

    /* copy key name */
    Length = min(ProductNameSize * sizeof(WCHAR), PartialInformation->DataLength);
    RtlMoveMemory(ProductName, (PVOID)PartialInformation->Data, Length);

    /* zero terminate it */
    ProductName[ProductNameSize-1] = L'\0';

    /* free buffer */
    FreeItem(PartialInformation);

    return STATUS_SUCCESS;
}
开发者ID:GYGit,项目名称:reactos,代码行数:60,代码来源:sup.c


示例2: FreeEventData

VOID
FreeEventData(IN PVOID EventData)
{
    PKSEVENTDATA Data = (PKSEVENTDATA)EventData;

    FreeItem(Data->EventHandle.Event);
    FreeItem(Data);
}
开发者ID:hoangduit,项目名称:reactos,代码行数:8,代码来源:mmixer.c


示例3: USBCCGP_GetStringDescriptor

NTSTATUS
NTAPI
USBCCGP_GetStringDescriptor(
    IN PDEVICE_OBJECT DeviceObject,
    IN ULONG DescriptorLength,
    IN UCHAR DescriptorIndex,
    IN LANGID LanguageId,
    OUT PVOID *OutDescriptor)
{
    NTSTATUS Status;
    PUSB_STRING_DESCRIPTOR StringDescriptor;
    ULONG Size;
    PVOID Buffer;

    // retrieve descriptor
    Status = USBCCGP_GetDescriptor(DeviceObject, USB_STRING_DESCRIPTOR_TYPE, DescriptorLength, DescriptorIndex, LanguageId, OutDescriptor);
    if (!NT_SUCCESS(Status))
    {
        // failed
        return Status;
    }

    // get descriptor structure
    StringDescriptor = (PUSB_STRING_DESCRIPTOR)*OutDescriptor;

    // sanity check
    ASSERT(StringDescriptor->bLength < DescriptorLength - 2);

    if (StringDescriptor->bLength == 2)
    {
        // invalid descriptor
        FreeItem(StringDescriptor);
        return STATUS_DEVICE_DATA_ERROR;
    }

    // calculate size
    Size = StringDescriptor->bLength + sizeof(WCHAR);

    // allocate buffer
    Buffer = AllocateItem(NonPagedPool, Size);
    if (!Buffer)
    {
        // no memory
        FreeItem(StringDescriptor);
        return STATUS_INSUFFICIENT_RESOURCES;
    }

    // copy result
    RtlCopyMemory(Buffer, StringDescriptor->bString, Size - FIELD_OFFSET(USB_STRING_DESCRIPTOR, bString));

    // free buffer
    FreeItem(StringDescriptor);

    // store result
    *OutDescriptor = (PVOID)Buffer;
    return STATUS_SUCCESS;
}
开发者ID:RPG-7,项目名称:reactos,代码行数:57,代码来源:descriptor.c


示例4: test_Enqueue

TEST
test_Enqueue(){
	Queue q;
	Node *newItem, *newItem2, *newItem3;
	InitQueue(&q);
	
	newItem = NewItem();
	
	//add item to queue
	AddQueue(&q, newItem);

	ASSERT(q.head == newItem);
	ASSERT(q.tail == newItem);
	ASSERT(q.count == 1);

	newItem2 = NewItem();
	AddQueue(&q, newItem2);

	//make sure that head val has not changed, and only tail val has changed
	ASSERT(q.head == newItem);
	ASSERT(q.tail == newItem2);
	ASSERT(q.count == 2);
	//head should point at tail
	ASSERT(q.head->next == q.tail);

	//one more for good measure
	newItem3 = NewItem();
	AddQueue(&q, newItem3);
	//head has not changed, as we add to the end
	ASSERT(q.head == newItem);
	//tail is our new item
	ASSERT(q.tail == newItem3);
	//count updated correctly
	ASSERT(q.count == 3);
	//head.prev points to tail
	ASSERT(q.head->prev == q.tail);
	//head.next does not point to tail, points to middle
	ASSERT(q.head->next == newItem2);
	//3 items, all connected
	ASSERT(q.head->next->next == q.tail);
	//tail.next == head
	ASSERT(q.tail->next == q.head);
	
	//free items
	FreeItem(newItem);
	FreeItem(newItem2);
	FreeItem(newItem3);


	PASS();
}
开发者ID:jjrob13,项目名称:CSE430,代码行数:51,代码来源:proj_1.c


示例5: test_RotateQ

TEST
test_RotateQ(){

	Queue q;
	InitQueue(&q);
	Node *newItem1, *newItem2, *newItem3, *newItem4;

	newItem1 = NewItem();
	newItem2 = NewItem();
	newItem3 = NewItem();
	newItem4 = NewItem();

	AddQueue(&q, newItem1);
	AddQueue(&q, newItem2);
	AddQueue(&q, newItem3);
	AddQueue(&q, newItem4);

	//Queue is 1 2 3 4
	ASSERT(q.head == newItem1);
	ASSERT(q.tail == newItem4);

	RotateQ(&q);
	//Queue is 2 3 4 1
	ASSERT(q.head == newItem2);
	ASSERT(q.tail == newItem1);

	RotateQ(&q);
	//Queue is 3 4 1 2
	ASSERT(q.head == newItem3);
	ASSERT(q.tail == newItem2);

	RotateQ(&q);
	//Queue is 4 1 2 3
	ASSERT(q.head == newItem4);
	ASSERT(q.tail == newItem3);

	RotateQ(&q);
	//Queue is 1 2 3 4
	ASSERT(q.head == newItem1);
	ASSERT(q.tail == newItem4);

	FreeItem(newItem1);
	FreeItem(newItem2);
	FreeItem(newItem3);
	FreeItem(newItem4);
	
	PASS();
}
开发者ID:jjrob13,项目名称:CSE430,代码行数:48,代码来源:proj_1.c


示例6: RemoveItem

/**
 * Remove the specified DrmData item <code>d</code>.
 *
 * @param p - the pointer of the DRM content InputStream object.
 *
 * @return <code>JNI_DRM_SUCCESS</code> if remove successfuly,
 *         otherwise return <code>JNI_DRM_FAILURE</code>
 */
static int32_t RemoveItem(int32_t id)
{
    DrmData *curItem, *preItem;

    if (NULL == drmTable)
        return CDrmRawContent::JNI_DRM_FAILURE;

    preItem = NULL;
    for (curItem = drmTable; curItem != NULL; curItem = curItem->next) {
        if (id == curItem->id) {
            if (curItem == drmTable)
                drmTable = curItem->next;
            else
                preItem->next = curItem->next;

            FreeItem(curItem);

            return CDrmRawContent::JNI_DRM_SUCCESS;
        }

        preItem = curItem;
    }

    return CDrmRawContent::JNI_DRM_FAILURE;
}
开发者ID:imace,项目名称:ElastosRDK5_0,代码行数:33,代码来源:CDrmRawContent.cpp


示例7: KsUnregisterWorker

/*
    @implemented
*/
KSDDKAPI
VOID
NTAPI
KsUnregisterWorker(
    IN  PKSWORKER Worker)
{
    PKSIWORKER KsWorker;
    KIRQL OldIrql;

    if (!Worker)
        return;

    /* get ks worker implementation */
    KsWorker = (PKSIWORKER)Worker;
    /* acquire spinlock */
    KeAcquireSpinLock(&KsWorker->Lock, &OldIrql);
    /* fake status running to avoid work items to be queued by the counted worker */
    KsWorker->Counter = 1;
    /* is there currently a work item active */
    if (KsWorker->QueuedWorkItemCount)
    {
        /* release the lock */
        KeReleaseSpinLock(&KsWorker->Lock, OldIrql);
        /* wait for the worker routine to finish */
        KeWaitForSingleObject(&KsWorker->Event, Executive, KernelMode, FALSE, NULL);
    }
    else
    {
        /* no work item active, just release the lock */
        KeReleaseSpinLock(&KsWorker->Lock, OldIrql);
    }
    /* free worker context */
    FreeItem(KsWorker);
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:37,代码来源:worker.c


示例8: Dispatch_fnClose

NTSTATUS
NTAPI
Dispatch_fnClose(
    PDEVICE_OBJECT DeviceObject,
    PIRP Irp)
{
    PIO_STACK_LOCATION IoStack;
    PDISPATCH_CONTEXT DispatchContext;
    NTSTATUS Status;

    // get current irp stack
    IoStack = IoGetCurrentIrpStackLocation(Irp);
    // get dispatch context
    DispatchContext = (PDISPATCH_CONTEXT)IoStack->FileObject->FsContext;

    // let IrpTarget handle request
    Status = DispatchContext->Target->Close(DeviceObject, Irp);

    if (NT_SUCCESS(Status))
    {
       KsFreeObjectHeader(DispatchContext->ObjectHeader);
       FreeItem(DispatchContext, TAG_PORTCLASS);
    }
    // done
    return Status;
}
开发者ID:RareHare,项目名称:reactos,代码行数:26,代码来源:dispatcher.cpp


示例9: KsValidateClockCreateRequest

/*
    @implemented
*/
KSDDKAPI
NTSTATUS
NTAPI
KsValidateClockCreateRequest(
    IN  PIRP Irp,
    OUT PKSCLOCK_CREATE* OutClockCreate)
{
    PKSCLOCK_CREATE ClockCreate;
    NTSTATUS Status;
    ULONG Size;

    /* minimum request size */
    Size = sizeof(KSCLOCK_CREATE);

    /* copy create request */
    Status = KspCopyCreateRequest(Irp, 
                                  KSSTRING_Clock,
                                  &Size,
                                  (PVOID*)&ClockCreate);

    if (!NT_SUCCESS(Status))
        return Status;

    if (ClockCreate->CreateFlags != 0)
    {
        /* flags must be zero */
        FreeItem(ClockCreate);
        return STATUS_INVALID_PARAMETER;
    }

    *OutClockCreate = ClockCreate;
    return STATUS_SUCCESS;
}
开发者ID:Moteesh,项目名称:reactos,代码行数:36,代码来源:clocks.c


示例10: Pin_fnClose

NTSTATUS
NTAPI
Pin_fnClose(
    PDEVICE_OBJECT DeviceObject,
    PIRP Irp)
{
    PDISPATCH_CONTEXT Context;
    PIO_STACK_LOCATION IoStack;

    //DPRINT("Pin_fnClose called DeviceObject %p Irp %p\n", DeviceObject, Irp);

    /* Get current stack location */
    IoStack = IoGetCurrentIrpStackLocation(Irp);

    /* The dispatch context is stored in the FsContext member */
    Context = (PDISPATCH_CONTEXT)IoStack->FileObject->FsContext;

    if (Context->Handle)
    {
        ZwClose(Context->Handle);
    }

    if (Context->hMixerPin)
    {
        ZwClose(Context->hMixerPin);
    }

    FreeItem(Context);

    Irp->IoStatus.Status = STATUS_SUCCESS;
    Irp->IoStatus.Information = 0;
    IoCompleteRequest(Irp, IO_NO_INCREMENT);
    return STATUS_SUCCESS;
}
开发者ID:GYGit,项目名称:reactos,代码行数:34,代码来源:pin.c


示例11: GetFirstTaskItemFromDB

/*
*****************************************************************************
**
** FUNCTION NAME: GetFirstTaskItemFromDB
**
** FUNCTION INPUTS:
**         ptrEncodeItem: the  encode information struct.
**
** FUNCTION DESCRIPTION
**        get the first record from the zriptask.db, and receive the total record of the db.
**
** FUNCTION OUTPUTS:
**       return: the count of the enc_pending record in the zriptask.db.
** HISTORY:
**
**           2008-7-2       HChen  Created.
**
*****************************************************************************
*/
int GetFirstTaskItemFromDB(PENC_PENDING ptrEncodeItem)
{ 
    int nRetVal = 0;
    char **result;
    int nRow, nCol; 

    if(QueryPendingTask(ENCPENDING,&result,&nRow,&nCol) == ZAPP_SUCCESS)
    {
        if((nRow >= 1)
            &&(result)
            &&(result[1*nCol+0])
            &&(result[1*nCol+1])
            &&(result[1*nCol+2]))
         {
            ZFREE(gObjID);
            gObjID = strdup(result[1*nCol+0]);    /*get the first record's objid of the db*/
            if((ConvertTask.eThreadStatus == THREAD_FINISHED) /*if the  ConvertTask is finished, the set value to the global struct*/
                &&(ConvertTask.eItemStatus == ITEM_ENCODED))
              {
                ConvertTask.nAccTrackNum++;
                ConvertTask.eItemStatus = ITEM_INIT;
                FreeItem(ptrEncodeItem);
                ptrEncodeItem->objID = strdup(result[1*nCol+0]);
                ptrEncodeItem->ptrAudioFormat = strdup(result[1*nCol+1]);
                ptrEncodeItem->ptrFormatCfg = strdup(result[1*nCol+2]);
              }
         }
        nRetVal = nRow;
    }
   if(result)
   {
      ZripTaskFreeResult(result);	
   }
    return nRetVal;
}
开发者ID:jamesyan84,项目名称:zbase,代码行数:54,代码来源:Convert.c


示例12: PwrCompletionFunction

VOID
CALLBACK
PwrCompletionFunction(
    IN PDEVICE_OBJECT DeviceObject,
    IN UCHAR MinorFunction,
    IN POWER_STATE PowerState,
    IN PVOID Context,
    IN PIO_STATUS_BLOCK IoStatus)
{
    NTSTATUS Status;
    PQUERY_POWER_CONTEXT PwrContext = (PQUERY_POWER_CONTEXT)Context;

    if (NT_SUCCESS(IoStatus->Status))
    {
        // forward request to lower device object
        Status = PcForwardIrpSynchronous(PwrContext->DeviceObject, PwrContext->Irp);
    }
    else
    {
        // failed
        Status = IoStatus->Status;
    }

    // start next power irp
    PoStartNextPowerIrp(PwrContext->Irp);

    // complete request
    PwrContext->Irp->IoStatus.Status = Status;
    IoCompleteRequest(PwrContext->Irp, IO_NO_INCREMENT);

    // free context
    FreeItem(PwrContext, TAG_PORTCLASS);
}
开发者ID:RareHare,项目名称:reactos,代码行数:33,代码来源:irp.cpp


示例13: IKsFilterFactory_fnRelease

ULONG
NTAPI
IKsFilterFactory_fnRelease(
    IKsFilterFactory * iface)
{
    IKsFilterFactoryImpl * This = (IKsFilterFactoryImpl*)CONTAINING_RECORD(iface, IKsFilterFactoryImpl, Header.OuterUnknown);

    InterlockedDecrement(&This->ref);

    if (This->ref == 0)
    {
        if (!IsListEmpty(&This->SymbolicLinkList))
        {
            /* disable device interfaces */
            KspSetDeviceInterfacesState(&This->SymbolicLinkList, FALSE);
            /* free device interface strings */
            KspFreeDeviceInterfaces(&This->SymbolicLinkList);
        }

        FreeItem(This);
        return 0;
    }
    /* Return new reference count */
    return This->ref;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:25,代码来源:filterfactory.c


示例14: KsCreateDefaultClock

/*
    @implemented
*/
KSDDKAPI
NTSTATUS
NTAPI
KsCreateDefaultClock(
    IN  PIRP Irp,
    IN  PKSDEFAULTCLOCK DefaultClock)
{
    NTSTATUS Status;
    PKSCLOCK_CREATE ClockCreate;
    PKSICLOCK Clock;

    Status = KsValidateClockCreateRequest(Irp, &ClockCreate);
    if (!NT_SUCCESS(Status))
        return Status;

    /* let's allocate the clock struct */
    Clock = AllocateItem(NonPagedPool, sizeof(KSICLOCK));
    if (!Clock)
    {
        FreeItem(ClockCreate);
        return STATUS_INSUFFICIENT_RESOURCES;
    }

    /* now allocate the object header */
    Status = KsAllocateObjectHeader((PVOID*)&Clock->ObjectHeader, 0, NULL, Irp, &DispatchTable);

    /* did it work */
    if (!NT_SUCCESS(Status))
    {
        /* failed */
        FreeItem(ClockCreate);
        FreeItem(Clock);
        return Status;
    }

    /* initialize clock */
    /* FIXME IKsClock */
    Clock->ObjectHeader->ObjectType = (PVOID)Clock;
    Clock->ref = 1;
    Clock->ClockCreate = ClockCreate;
    Clock->DefaultClock = (PKSIDEFAULTCLOCK)DefaultClock;

    /* increment reference count */
    InterlockedIncrement(&Clock->DefaultClock->ReferenceCount);

    return Status;
}
开发者ID:Moteesh,项目名称:reactos,代码行数:50,代码来源:clocks.c


示例15: Enum

MIXER_STATUS
Enum(
    IN  PVOID EnumContext,
    IN  ULONG DeviceIndex,
    OUT LPWSTR * DeviceName,
    OUT PHANDLE OutHandle,
    OUT PHANDLE OutKey)
{
    PDEVICE_OBJECT DeviceObject;
    ULONG DeviceCount;
    NTSTATUS Status;
    UNICODE_STRING KeyName;

    /* get enumeration context */
    DeviceObject = (PDEVICE_OBJECT)EnumContext;

    /* get device count */
    DeviceCount = GetSysAudioDeviceCount(DeviceObject);

    if (DeviceIndex >= DeviceCount)
    {
        /* no more devices */
        return MM_STATUS_NO_MORE_DEVICES;
    }

    /* get device name */
    Status = GetSysAudioDevicePnpName(DeviceObject, DeviceIndex, DeviceName);

    if (!NT_SUCCESS(Status))
    {
        /* failed to retrieve device name */
        return MM_STATUS_UNSUCCESSFUL;
    }

    /* intialize key name */
    RtlInitUnicodeString(&KeyName, *DeviceName);

    /* open device interface key */
    Status = IoOpenDeviceInterfaceRegistryKey(&KeyName, GENERIC_READ | GENERIC_WRITE, OutKey);
#if 0
    if (!NT_SUCCESS(Status))
    {
        /* failed to open key */
        DPRINT("IoOpenDeviceInterfaceRegistryKey failed with %lx\n", Status);
        FreeItem(*DeviceName);
        return MM_STATUS_UNSUCCESSFUL;
    }
#endif

    /* open device handle */
    Status = OpenDevice(*DeviceName, OutHandle, NULL);
    if (!NT_SUCCESS(Status))
    {
        /* failed to open device */
        return MM_STATUS_UNSUCCESSFUL;
    }

    return MM_STATUS_SUCCESS;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:59,代码来源:mmixer.c


示例16: IoCompletion

NTSTATUS
NTAPI
IoCompletion (
    PDEVICE_OBJECT DeviceObject,
    PIRP Irp,
    PVOID Ctx)
{
    PKSSTREAM_HEADER Header;
    ULONG Length = 0;
    PMDL Mdl, NextMdl;
    PWDMAUD_COMPLETION_CONTEXT Context = (PWDMAUD_COMPLETION_CONTEXT)Ctx;

    /* get stream header */
    Header = (PKSSTREAM_HEADER)Irp->AssociatedIrp.SystemBuffer;

    /* sanity check */
    ASSERT(Header);

    /* time to free all allocated mdls */
    Mdl = Irp->MdlAddress;

    while(Mdl)
    {
        /* get next mdl */
        NextMdl = Mdl->Next;

        /* unlock pages */
        MmUnlockPages(Mdl);

        /* grab next mdl */
        Mdl = NextMdl;
    }

    /* clear mdl list */
    Irp->MdlAddress = NULL;

   /* check if mdl is locked */
    if (Context->Mdl->MdlFlags & MDL_PAGES_LOCKED)
    {
        /* unlock pages */
        MmUnlockPages(Context->Mdl);
    }

    /* now free the mdl */
    IoFreeMdl(Context->Mdl);

    DPRINT("IoCompletion Irp %p IoStatus %lx Information %lx Length %lu\n", Irp, Irp->IoStatus.Status, Irp->IoStatus.Information, Length);

    if (!NT_SUCCESS(Irp->IoStatus.Status))
    {
        /* failed */
        Irp->IoStatus.Information = 0;
    }

    /* free context */
    FreeItem(Context);

    return STATUS_SUCCESS;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:59,代码来源:control.c


示例17: KsFreeObjectBag

/*
    @implemented
*/
KSDDKAPI
VOID
NTAPI
KsFreeObjectBag(
    IN KSOBJECT_BAG ObjectBag)
{
    PLIST_ENTRY Entry;
    PKSIOBJECT_BAG Bag;
    PKSIOBJECT_BAG_ENTRY BagEntry;
    ULONG TotalRefs;

    /* get real object bag */
    Bag = (PKSIOBJECT_BAG)ObjectBag;

    /* acquire bag mutex */
    KeWaitForSingleObject(Bag->BagMutex, Executive, KernelMode, FALSE, NULL);

    while(!IsListEmpty(&Bag->ObjectList))
    {
        /* get an bag entry */
        Entry = RemoveHeadList(&Bag->ObjectList);
        /* access bag entry item */
        BagEntry = (PKSIOBJECT_BAG_ENTRY)CONTAINING_RECORD(Entry, KSIOBJECT_BAG, Entry);

        /* check if the item is present in some other bag */
        TotalRefs = KspGetObjectItemReferenceCount((PKSIDEVICE_HEADER)Bag->DeviceHeader, &BagEntry->Item);

        if (TotalRefs == 0)
        {
            /* item is ready to be freed */
            BagEntry->Free(BagEntry->Item);
        }

        /* free bag entry item */
        FreeItem(BagEntry);
    }

    /* remove bag entry from device object list */
    RemoveEntryList(&Bag->Entry);

    /* release bag mutex */
    KeReleaseMutex(Bag->BagMutex, FALSE);

    /* now free object bag */
    FreeItem(Bag);
}
开发者ID:RareHare,项目名称:reactos,代码行数:49,代码来源:bag.c


示例18: At

void CCollection::AtFree(int nIndex)
{
    void * pItem;

    pItem = At(nIndex);
    if (pItem)
        FreeItem(pItem);
    AtDelete(nIndex);
}
开发者ID:erwin47,项目名称:alh,代码行数:9,代码来源:collection.cpp


示例19: test_NewItem

TEST
test_NewItem(){
	Node * newItem;
	newItem = NewItem();
	ASSERT(newItem);

	FreeItem(newItem);

	PASS();
}
开发者ID:jjrob13,项目名称:CSE430,代码行数:10,代码来源:proj_1.c


示例20: ReadKeyValue

PKEY_VALUE_PARTIAL_INFORMATION
ReadKeyValue(
    IN HANDLE hSubKey,
    IN PUNICODE_STRING KeyName)
{
    NTSTATUS Status;
    ULONG Length;
    PKEY_VALUE_PARTIAL_INFORMATION PartialInformation;

    /* now query MatchingDeviceId key */
    Status = ZwQueryValueKey(hSubKey, KeyName, KeyValuePartialInformation, NULL, 0, &Length);

    /* check for success */
    if (Status != STATUS_BUFFER_TOO_SMALL)
        return NULL;

    /* allocate a buffer for key data */
    PartialInformation = AllocateItem(NonPagedPool, Length);

    if (!PartialInformation)
        return NULL;


    /* now query MatchingDeviceId key */
    Status = ZwQueryValueKey(hSubKey, KeyName, KeyValuePartialInformation, PartialInformation, Length, &Length);

    /* check for success */
    if (!NT_SUCCESS(Status))
    {
        FreeItem(PartialInformation);
        return NULL;
    }

    if (PartialInformation->Type != REG_SZ)
    {
        /* invalid key type */
        FreeItem(PartialInformation);
        return NULL;
    }

    return PartialInformation;
}
开发者ID:GYGit,项目名称:reactos,代码行数:42,代码来源:sup.c



注:本文中的FreeItem函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FreeLibrary函数代码示例发布时间:2022-05-30
下一篇:
C++ FreeImage_Unload函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap