⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 osapi_memory.c

📁 这是DVD中伺服部分的核心代码
💻 C
字号:
/*****************************************************************************
******************************************************************************
**                                                                          **
**  Copyright (c) 2006 Videon Central, Inc.                                 **
**  All rights reserved.                                                    **
**                                                                          **
**  The computer program contained herein contains proprietary information  **
**  which is the property of Videon Central, Inc.  The program may be used  **
**  and/or copied only with the written permission of Videon Central, Inc.  **
**  or in accordance with the terms and conditions stipulated in the        **
**  agreement/contract under which the programs have been supplied.         **
**                                                                          **
******************************************************************************
*****************************************************************************/
/**
 * @file osapi_memory.cpp
 *
 * $Revision: 1.5 $ 
 *
 * Operating System API (OSAPI) source file. Provides an abstraction from the
 * operating system.
 *
 * This is the implementation for win32
 *
 */

#include "osapi.h"
#include "dbgprint.h"
#include <stdlib.h>


PVOID OS_MemAlloc(ULONG ulSize)
{
    PVOID pvMemory = NULL;

    if (ulSize == 0)
    {
        DbgPrint(("OS_MemAlloc: Memory size is 0!\n"));
        return (NULL);
    }
    pvMemory = malloc(ulSize);


    DbgAssert(pvMemory != NULL);

    return (pvMemory);
}






OS_STATUS OS_MemFree(PVOID pvMemory)
{
    if (pvMemory == NULL)
    {
        DbgPrint(("OS_MemFree: Memory pointer is NULL!\n"));
        return (OS_NULL_POINTER);
    }

    free(pvMemory);

    return (OS_OK);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -