您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetProcAddress函数代码示例

51自学网 2021-06-01 21:13:31
  C++
这篇教程C++ GetProcAddress函数代码示例写得很实用,希望能帮到您。

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

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

示例1: my_gethwaddr

/*  my_gethwaddr - Windows version  @brief Retrieve MAC address from network hardware  @param[out]  to MAC address exactly six bytes  @return Operation status    @retval 0       OK    @retval <>0     FAILED*/my_bool my_gethwaddr(uchar *to){  PIP_ADAPTER_ADDRESSES pAdapterAddresses;  PIP_ADAPTER_ADDRESSES pCurrAddresses;  IP_ADAPTER_ADDRESSES  adapterAddresses;  ULONG                 address_len;  my_bool               return_val= 1;  static pfnGetAdaptersAddresses fnGetAdaptersAddresses=                                (pfnGetAdaptersAddresses)-1;  if (fnGetAdaptersAddresses == (pfnGetAdaptersAddresses)-1)  {    /* Get the function from the DLL */    fnGetAdaptersAddresses= (pfnGetAdaptersAddresses)                            GetProcAddress(LoadLibrary("iphlpapi.dll"),                                          "GetAdaptersAddresses");  }  if (!fnGetAdaptersAddresses)    return 1;                                   /* failed to get function */  address_len= sizeof (IP_ADAPTER_ADDRESSES);  /* Get the required size for the address data. */  if (fnGetAdaptersAddresses(AF_UNSPEC, 0, 0, &adapterAddresses, &address_len)      == ERROR_BUFFER_OVERFLOW)  {    pAdapterAddresses= my_malloc(address_len, 0);    if (!pAdapterAddresses)      return 1;                                   /* error, alloc failed */  }  else    pAdapterAddresses= &adapterAddresses;         /* one is enough don't alloc */  /* Get the hardware info. */  if (fnGetAdaptersAddresses(AF_UNSPEC, 0, 0, pAdapterAddresses, &address_len)      == NO_ERROR)  {    pCurrAddresses= pAdapterAddresses;    while (pCurrAddresses)    {      /* Look for ethernet cards. */      if (pCurrAddresses->IfType == IF_TYPE_ETHERNET_CSMACD)      {        /* check for a good address */        if (pCurrAddresses->PhysicalAddressLength < 6)            continue;                           /* bad address */        /* save 6 bytes of the address in the 'to' parameter */        memcpy(to, pCurrAddresses->PhysicalAddress, 6);        /* Network card found, we're done. */        return_val= 0;        break;      }      pCurrAddresses= pCurrAddresses->Next;    }  }  /* Clean up memory allocation. */  if (pAdapterAddresses != &adapterAddresses)    my_free(pAdapterAddresses);  return return_val;}
开发者ID:Dudelzack,项目名称:blizzlikecore,代码行数:75,


示例2: xmlModulePlatformSymbol

static intxmlModulePlatformSymbol(void *handle, const char *name, void **symbol){    *symbol = GetProcAddress(handle, name);    return (NULL == *symbol) ? -1 : 0;}
开发者ID:SCIInstitute,项目名称:SCIRun,代码行数:6,


示例3: getProcAddress

	RKT_API Proc getProcAddress(void* moduleHandle, const char* procName)	{		return reinterpret_cast<Proc>(GetProcAddress((HMODULE)moduleHandle, procName));	}
开发者ID:lorichen,项目名称:xgame,代码行数:4,


示例4: init_heap

voidinit_heap (void){  if (using_dynamic_heap)    {      unsigned long enable_lfh = 2;      /* After dumping, use a new private heap.  We explicitly enable         the low fragmentation heap (LFH) here, for the sake of pre         Vista versions.  Note: this will harmlessly fail on Vista and         later, where the low-fragmentation heap is enabled by         default.  It will also fail on pre-Vista versions when Emacs         is run under a debugger; set _NO_DEBUG_HEAP=1 in the         environment before starting GDB to get low fragmentation heap         on XP and older systems, for the price of losing "certain         heap debug options"; for the details see         http://msdn.microsoft.com/en-us/library/windows/desktop/aa366705%28v=vs.85%29.aspx.  */      data_region_end = data_region_base;      /* Create the private heap.  */      heap = HeapCreate (0, 0, 0);#ifndef MINGW_W64      /* Set the low-fragmentation heap for OS before Vista.  */      HMODULE hm_kernel32dll = LoadLibrary ("kernel32.dll");      HeapSetInformation_Proc s_pfn_Heap_Set_Information = (HeapSetInformation_Proc) GetProcAddress (hm_kernel32dll, "HeapSetInformation");      if (s_pfn_Heap_Set_Information != NULL)	{	  if (s_pfn_Heap_Set_Information ((PVOID) heap,					  HeapCompatibilityInformation,					  &enable_lfh, sizeof(enable_lfh)) == 0)	    DebPrint (("Enabling Low Fragmentation Heap failed: error %ld/n",		       GetLastError ()));	}#endif      if (os_subtype == OS_9X)        {          the_malloc_fn = malloc_after_dump_9x;          the_realloc_fn = realloc_after_dump_9x;          the_free_fn = free_after_dump_9x;        }      else        {          the_malloc_fn = malloc_after_dump;          the_realloc_fn = realloc_after_dump;          the_free_fn = free_after_dump;        }    }  else    {      /* Find the RtlCreateHeap function.  Headers for this function         are provided with the w32 DDK, but the function is available         in ntdll.dll since XP.  */      HMODULE hm_ntdll = LoadLibrary ("ntdll.dll");      RtlCreateHeap_Proc s_pfn_Rtl_Create_Heap	= (RtlCreateHeap_Proc) GetProcAddress (hm_ntdll, "RtlCreateHeap");      /* Specific parameters for the private heap.  */      RTL_HEAP_PARAMETERS params;      ZeroMemory (&params, sizeof(params));      params.Length = sizeof(RTL_HEAP_PARAMETERS);      data_region_base = (unsigned char *)ROUND_UP (dumped_data, 0x1000);      data_region_end = bc_limit = dumped_data + DUMPED_HEAP_SIZE;      params.InitialCommit = committed = 0x1000;      params.InitialReserve = sizeof(dumped_data);      /* Use our own routine to commit memory from the dumped_data         array.  */      params.CommitRoutine = &dumped_data_commit;      /* Create the private heap.  */      if (s_pfn_Rtl_Create_Heap == NULL)	{	  fprintf (stderr, "Cannot build Emacs without RtlCreateHeap being available; exiting./n");	  exit (-1);	}      heap = s_pfn_Rtl_Create_Heap (0, data_region_base, 0, 0, NULL, &params);      if (os_subtype == OS_9X)        {          fprintf (stderr, "Cannot dump Emacs on Windows 9X; exiting./n");          exit (-1);        }      else        {          the_malloc_fn = malloc_before_dump;          the_realloc_fn = realloc_before_dump;          the_free_fn = free_before_dump;        }    }  /* Update system version information to match current system.  */  cache_system_info ();}
开发者ID:Wilfred,项目名称:emacs,代码行数:95,


示例5: CreateRestrictedProcess

/* * Create a restricted token and execute the specified process with it. * * Returns restricted token on success and 0 on failure. * * On NT4, or any other system not containing the required functions, will * NOT execute anything. */HANDLECreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo, const char *progname){	BOOL		b;	STARTUPINFO si;	HANDLE		origToken;	HANDLE		restrictedToken;	SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY};	SID_AND_ATTRIBUTES dropSids[2];	__CreateRestrictedToken _CreateRestrictedToken = NULL;	HANDLE		Advapi32Handle;	ZeroMemory(&si, sizeof(si));	si.cb = sizeof(si);	Advapi32Handle = LoadLibrary("ADVAPI32.DLL");	if (Advapi32Handle != NULL)	{		_CreateRestrictedToken = (__CreateRestrictedToken) GetProcAddress(Advapi32Handle, "CreateRestrictedToken");	}	if (_CreateRestrictedToken == NULL)	{		fprintf(stderr, _("%s: WARNING: cannot create restricted tokens on this platform/n"), progname);		if (Advapi32Handle != NULL)			FreeLibrary(Advapi32Handle);		return 0;	}	/* Open the current token to use as a base for the restricted one */	if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &origToken))	{		fprintf(stderr, _("%s: could not open process token: error code %lu/n"), progname, GetLastError());		return 0;	}	/* Allocate list of SIDs to remove */	ZeroMemory(&dropSids, sizeof(dropSids));	if (!AllocateAndInitializeSid(&NtAuthority, 2,		 SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0,								  0, &dropSids[0].Sid) ||		!AllocateAndInitializeSid(&NtAuthority, 2,	SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_POWER_USERS, 0, 0, 0, 0, 0,								  0, &dropSids[1].Sid))	{		fprintf(stderr, _("%s: could not allocate SIDs: error code %lu/n"),				progname, GetLastError());		return 0;	}	b = _CreateRestrictedToken(origToken,							   DISABLE_MAX_PRIVILEGE,							   sizeof(dropSids) / sizeof(dropSids[0]),							   dropSids,							   0, NULL,							   0, NULL,							   &restrictedToken);	FreeSid(dropSids[1].Sid);	FreeSid(dropSids[0].Sid);	CloseHandle(origToken);	FreeLibrary(Advapi32Handle);	if (!b)	{		fprintf(stderr, _("%s: could not create restricted token: error code %lu/n"),				progname, GetLastError());		return 0;	}#ifndef __CYGWIN__	AddUserToTokenDacl(restrictedToken);#endif	if (!CreateProcessAsUser(restrictedToken,							 NULL,							 cmd,							 NULL,							 NULL,							 TRUE,							 CREATE_SUSPENDED,							 NULL,							 NULL,							 &si,							 processInfo))	{		fprintf(stderr, _("%s: could not start process for command /"%s/": error code %lu/n"), progname, cmd, GetLastError());		return 0;	}	ResumeThread(processInfo->hThread);//.........这里部分代码省略.........
开发者ID:ArgenBarbie,项目名称:postgresql-9.5.0,代码行数:101,


示例6: ZeroMalloc

// Create a VLAN objectVLAN *NewVLan(char *instance_name, VLAN_PARAM *param){	VLAN *v;	HANDLE h = INVALID_HANDLE_VALUE;	HANDLE e = INVALID_HANDLE_VALUE;	char tmp[MAX_SIZE];	char name_upper[MAX_SIZE];	// Validate arguments	if (instance_name == NULL)	{		return NULL;	}	v = ZeroMalloc(sizeof(VLAN));	if (OS_IS_WINDOWS_9X(GetOsInfo()->OsType))	{		v->Win9xMode = true;	}	// Initialize the name	Format(name_upper, sizeof(name_upper), "%s", instance_name);	StrUpper(name_upper);	v->InstanceName = CopyStr(name_upper);	Format(tmp, sizeof(tmp), NDIS_NEO_DEVICE_FILE_NAME, v->InstanceName);	v->DeviceNameWin32 = CopyStr(tmp);	if (v->Win9xMode == false)	{		Format(tmp, sizeof(tmp), NDIS_NEO_EVENT_NAME_WIN32, v->InstanceName);		v->EventNameWin32 = CopyStr(tmp);	}	// Connect to the device	h = CreateFile(v->DeviceNameWin32,		GENERIC_READ | GENERIC_WRITE,		0,		NULL,		OPEN_EXISTING,		0,		NULL);	if (h == INVALID_HANDLE_VALUE)	{		// Connection failure		goto CLEANUP;	}	if (v->Win9xMode == false)	{		// Connect to the event		e = OpenEvent(SYNCHRONIZE, FALSE, v->EventNameWin32);		if (e == INVALID_HANDLE_VALUE)		{			// Connection failure			goto CLEANUP;		}	}	else	{		OPENVXDHANDLE OpenVxDHandle;		DWORD vxd_handle;		UINT bytes_returned;		OpenVxDHandle = (OPENVXDHANDLE)GetProcAddress(GetModuleHandle("KERNEL32"),			"OpenVxDHandle");		// Deliver to the driver by creating an event		e = CreateEvent(NULL, FALSE, FALSE, NULL);		vxd_handle = (DWORD)OpenVxDHandle(e);		DeviceIoControl(h, NEO_IOCTL_SET_EVENT, &vxd_handle, sizeof(DWORD),			NULL, 0, &bytes_returned, NULL);	}	v->Event = e;	v->Handle = h;	v->GetBuffer = ZeroMalloc(NEO_EXCHANGE_BUFFER_SIZE);	v->PutBuffer = ZeroMalloc(NEO_EXCHANGE_BUFFER_SIZE);	return v;CLEANUP:	if (h != INVALID_HANDLE_VALUE)	{		CloseHandle(h);	}	if (e != INVALID_HANDLE_VALUE)	{		CloseHandle(e);	}	Free(v->InstanceName);	Free(v->EventNameWin32);	Free(v->DeviceNameWin32);	Free(v);	return NULL;}
开发者ID:benapetr,项目名称:SoftEtherVPN,代码行数:100,


示例7: ExecFile

int ExecFile(const char *pszFilePath, char *lpFile){    DWORD dwBytes;    void *lpImageBase = NULL;    // check the image dos header    IMAGE_DOS_HEADER *pImageDosHeader = (IMAGE_DOS_HEADER *) lpFile;    if(pImageDosHeader->e_magic != IMAGE_DOS_SIGNATURE) {        return FALSE;    }    // check the image nt headers    IMAGE_NT_HEADERS *pImageNtHeaders = (IMAGE_NT_HEADERS *)(lpFile +                                        pImageDosHeader->e_lfanew);    if(pImageNtHeaders->Signature != IMAGE_NT_SIGNATURE) {        return FALSE;    }    // start the new process which we will overwrite later    STARTUPINFOA StartupInfo = {sizeof(STARTUPINFOA)};    PROCESS_INFORMATION ProcessInformation = {0};    if(CreateProcess(pszFilePath, NULL, NULL, NULL, FALSE,                     CREATE_SUSPENDED, NULL, NULL, &StartupInfo,                     &ProcessInformation) == FALSE) {        return FALSE;    }    // read the base address of the executable loaded in the    // process which we will inject    CONTEXT ctx = {CONTEXT_FULL};    DWORD dwImageBase;    if(GetThreadContext(ProcessInformation.hThread, &ctx) == FALSE ||            ReadProcessMemory(ProcessInformation.hProcess,                              (void *)(ctx.Ebx + 8), &dwImageBase, 4, &dwBytes) == FALSE ||            dwBytes != 4) {        goto cleanup;    }    // unmap the loaded binary if the base address conflicts    // with the binary which we want to load    if(dwImageBase == pImageNtHeaders->OptionalHeader.ImageBase) {        LP_NtUnmapViewOfSection pNtUnmapViewOfSection =            (LP_NtUnmapViewOfSection) GetProcAddress(                GetModuleHandleA("ntdll.dll"), "NtUnmapViewOfSection");        pNtUnmapViewOfSection(ProcessInformation.hProcess, dwImageBase);    }    // allocate memory in the remote process for our binary    lpImageBase = VirtualAllocEx(ProcessInformation.hProcess,                                 (void *) pImageNtHeaders->OptionalHeader.ImageBase,                                 pImageNtHeaders->OptionalHeader.SizeOfImage, MEM_COMMIT | MEM_RESERVE,                                 PAGE_EXECUTE_READWRITE);    if(lpImageBase == NULL) {        goto cleanup;    }    // write the headers of our binary to the process    if(WriteProcessMemory(ProcessInformation.hProcess, lpImageBase, lpFile,                          pImageNtHeaders->OptionalHeader.SizeOfHeaders, &dwBytes)            == FALSE ||            dwBytes != pImageNtHeaders->OptionalHeader.SizeOfHeaders) {        goto cleanup;    }    // enumerate all the sections in this binary    IMAGE_SECTION_HEADER *pImageSectionHeader = (IMAGE_SECTION_HEADER *)(                lpFile + pImageDosHeader->e_lfanew + sizeof(IMAGE_FILE_HEADER) +                sizeof(DWORD) + pImageNtHeaders->FileHeader.SizeOfOptionalHeader);    for (int i = 0; i < pImageNtHeaders->FileHeader.NumberOfSections;            i++, pImageSectionHeader++) {        // if this section has no size_of_raw_data, then we skip it because        // there is nothing to write        if(pImageSectionHeader->SizeOfRawData == 0) continue;        // and write each section to the correct address in the process        if(WriteProcessMemory(ProcessInformation.hProcess,                              (char *) lpImageBase + pImageSectionHeader->VirtualAddress,                              lpFile + pImageSectionHeader->PointerToRawData,                              pImageSectionHeader->SizeOfRawData, &dwBytes) == FALSE ||                pImageSectionHeader->SizeOfRawData != dwBytes) {            goto cleanup;        }    }    // write the new image base address    if(WriteProcessMemory(ProcessInformation.hProcess, (void *)(ctx.Ebx + 8),                          &lpImageBase, 4, &dwBytes) == FALSE || dwBytes != 4) {        goto cleanup;    }    // store the new entry point    ctx.Eax = (DWORD) lpImageBase +              pImageNtHeaders->OptionalHeader.AddressOfEntryPoint;    // write the new context containing the updated entry point to the process    SetThreadContext(ProcessInformation.hThread, &ctx);    // resume the main thread, start the application    ResumeThread(ProcessInformation.hThread);//.........这里部分代码省略.........
开发者ID:eldoon,项目名称:godware,代码行数:101,


示例8: winOsVersion

static inline OSVERSIONINFOEX winOsVersion(){    typedef NTSTATUS (NTAPI *RtlGetVersionFunction)(LPOSVERSIONINFO);    OSVERSIONINFOEX result = { sizeof(OSVERSIONINFOEX), 0, 0, 0, 0, {'/0'}, 0, 0, 0, 0, 0};    HMODULE ntdll = GetModuleHandleW(L"ntdll.dll");    if (ntdll ) {        RtlGetVersionFunction pRtlGetVersion = reinterpret_cast<RtlGetVersionFunction>(GetProcAddress(ntdll, "RtlGetVersion"));        if (pRtlGetVersion) {            pRtlGetVersion((LPOSVERSIONINFO) &result);        }    }    return result;}
开发者ID:NiceHashPro,项目名称:xmrig-proxy,代码行数:16,


示例9: ASSERT

bool PluginPackage::load(){    if (m_freeLibraryTimer.isActive()) {        ASSERT(m_module);        m_freeLibraryTimer.stop();    } else if (m_isLoaded) {        if (m_quirks.contains(PluginQuirkDontAllowMultipleInstances))            return false;        m_loadCount++;        return true;    } else {#if OS(WINCE)        m_module = ::LoadLibraryW(m_path.charactersWithNullTermination());#else        WCHAR currentPath[MAX_PATH];        if (!::GetCurrentDirectoryW(MAX_PATH, currentPath))            return false;        String path = m_path.substring(0, m_path.reverseFind('//'));        if (!::SetCurrentDirectoryW(path.charactersWithNullTermination()))            return false;        // Load the library        m_module = ::LoadLibraryExW(m_path.charactersWithNullTermination(), 0, LOAD_WITH_ALTERED_SEARCH_PATH);        if (!::SetCurrentDirectoryW(currentPath)) {            if (m_module)                ::FreeLibrary(m_module);            return false;        }#endif    }    if (!m_module)        return false;    m_isLoaded = true;    NP_GetEntryPointsFuncPtr NP_GetEntryPoints = 0;    NP_InitializeFuncPtr NP_Initialize = 0;    NPError npErr;#if OS(WINCE)    NP_Initialize = (NP_InitializeFuncPtr)GetProcAddress(m_module, L"NP_Initialize");    NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)GetProcAddress(m_module, L"NP_GetEntryPoints");    m_NPP_Shutdown = (NPP_ShutdownProcPtr)GetProcAddress(m_module, L"NP_Shutdown");#else    NP_Initialize = (NP_InitializeFuncPtr)GetProcAddress(m_module, "NP_Initialize");    NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)GetProcAddress(m_module, "NP_GetEntryPoints");    m_NPP_Shutdown = (NPP_ShutdownProcPtr)GetProcAddress(m_module, "NP_Shutdown");#endif    if (!NP_Initialize || !NP_GetEntryPoints || !m_NPP_Shutdown)        goto abort;    memset(&m_pluginFuncs, 0, sizeof(m_pluginFuncs));    m_pluginFuncs.size = sizeof(m_pluginFuncs);    npErr = NP_GetEntryPoints(&m_pluginFuncs);    LOG_NPERROR(npErr);    if (npErr != NPERR_NO_ERROR)        goto abort;    initializeBrowserFuncs();    npErr = NP_Initialize(&m_browserFuncs);    LOG_NPERROR(npErr);    if (npErr != NPERR_NO_ERROR)        goto abort;    m_loadCount++;    return true;abort:    unloadWithoutShutdown();    return false;}
开发者ID:wpbest,项目名称:copperspice,代码行数:80,


示例10: _GetCurrentProcessorNumber

    ///////////////////////////////////////////////////////////////////////////    //    // GetCurrentProcessorNumber for the current thread.    //    // Only a guide as it could change after the call has returned    //    ///////////////////////////////////////////////////////////////////////////    DWORD _GetCurrentProcessorNumber ( void )    {        DWORD dwProcessorNumber = -1;#ifdef WIN32        typedef DWORD (WINAPI *FUNC_GetCurrentProcessorNumber)( VOID );         // Dynamically load GetCurrentProcessorNumber, as it does not exist on XP        static FUNC_GetCurrentProcessorNumber pfn = NULL;        static bool bDone = false;        if ( !bDone )        {            HMODULE hModule = LoadLibraryA ( "Kernel32" );            pfn = static_cast < FUNC_GetCurrentProcessorNumber > ( static_cast < PVOID > ( GetProcAddress ( hModule, "GetCurrentProcessorNumber" ) ) );            bDone = true;        }        if ( pfn )            dwProcessorNumber = pfn ();#endif        return dwProcessorNumber;    }
开发者ID:0x688,项目名称:gtasa_crashfix,代码行数:28,


示例11: DRIVER_TryOpenDriver32

/************************************************************************** *				DRIVER_TryOpenDriver32		[internal] * * Tries to load a 32 bit driver whose DLL's (module) name is fn */LPWINE_DRIVER	DRIVER_TryOpenDriver32(LPCWSTR fn, LPARAM lParam2){    LPWINE_DRIVER 	lpDrv = NULL;    HMODULE		hModule = 0;    LPWSTR		ptr;    LPCSTR		cause = 0;    TRACE("(%s, %08lX);/n", debugstr_w(fn), lParam2);    if ((ptr = strchrW(fn, ' ')) != NULL) {	*ptr++ = '/0';	while (*ptr == ' ') ptr++;	if (*ptr == '/0') ptr = NULL;    }    lpDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_DRIVER));    if (lpDrv == NULL) {cause = "OOM"; goto exit;}    if ((hModule = LoadLibraryW(fn)) == 0) {cause = "Not a 32 bit lib"; goto exit;}    lpDrv->lpDrvProc = (DRIVERPROC)GetProcAddress(hModule, "DriverProc");    if (lpDrv->lpDrvProc == NULL) {cause = "no DriverProc"; goto exit;}    lpDrv->dwFlags    = 0;    lpDrv->hModule    = hModule;    lpDrv->dwDriverID = 0;    /* Win32 installable drivers must support a two phase opening scheme:     * + first open with NULL as lParam2 (session instance),     * + then do a second open with the real non null lParam2)     */    if (DRIVER_GetNumberOfModuleRefs(lpDrv->hModule, NULL) == 0 && lParam2)    {        LPWINE_DRIVER   ret;        if (!DRIVER_AddToList(lpDrv, (LPARAM)ptr, 0L))        {            cause = "load0 failed";            goto exit;        }        ret = DRIVER_TryOpenDriver32(fn, lParam2);        if (!ret)        {            CloseDriver((HDRVR)lpDrv, 0L, 0L);            cause = "load1 failed";            goto exit;        }        lpDrv->dwFlags |= WINE_GDF_SESSION;        return ret;    }    if (!DRIVER_AddToList(lpDrv, (LPARAM)ptr, lParam2))    {cause = "load failed"; goto exit;}    TRACE("=> %p/n", lpDrv);    return lpDrv; exit:    FreeLibrary(hModule);    HeapFree(GetProcessHeap(), 0, lpDrv);    TRACE("Unable to load 32 bit module %s: %s/n", debugstr_w(fn), cause);    return NULL;}
开发者ID:AlexSteel,项目名称:wine,代码行数:67,


示例12: sizeof

void SSLManager::loadSecurityLibrary(){	if (_hSecurityModule) return;	OSVERSIONINFO VerInfo;	std::wstring dllPath;	// Find out which security DLL to use, depending on	// whether we are on Win2k, NT or Win9x	VerInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);	if (!GetVersionEx(&VerInfo))		throw Poco::SystemException("Cannot determine OS version");#if defined(_WIN32_WCE)	dllPath = L"Secur32.dll";#else	if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT 		&& VerInfo.dwMajorVersion == 4)	{		dllPath = L"Security.dll";	}	else if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ||		VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )	{		dllPath = L"Secur32.dll";	}	else	{		throw Poco::SystemException("Cannot determine which security DLL to use");	}#endif	//	//  Load Security DLL	//	_hSecurityModule = LoadLibraryW(dllPath.c_str());	if(_hSecurityModule == 0)	{		throw Poco::SystemException("Failed to load security DLL");	}#if defined(_WIN32_WCE)	INIT_SECURITY_INTERFACE pInitSecurityInterface = (INIT_SECURITY_INTERFACE)GetProcAddressW( _hSecurityModule, L"InitSecurityInterfaceW");#else	INIT_SECURITY_INTERFACE pInitSecurityInterface = (INIT_SECURITY_INTERFACE)GetProcAddress( _hSecurityModule, "InitSecurityInterfaceW");#endif	if (!pInitSecurityInterface)	{		FreeLibrary(_hSecurityModule);		_hSecurityModule = 0;		throw Poco::SystemException("Failed to initialize security DLL (no init function)");	}	PSecurityFunctionTable pSecurityFunc = pInitSecurityInterface();	if (!pSecurityFunc)	{		FreeLibrary(_hSecurityModule);		_hSecurityModule = 0;		throw Poco::SystemException("Failed to initialize security DLL (no function table)");	}	CopyMemory(&_securityFunctions, pSecurityFunc, sizeof(_securityFunctions));}
开发者ID:Bjoe,项目名称:poco,代码行数:66,


示例13: InitOutput

voidInitOutput (ScreenInfo *screenInfo, int argc, char *argv[]){  int		i;  /* Log the command line */  winLogCommandLine (argc, argv);#if CYGDEBUG  winDebug ("InitOutput/n");#endif  /* Validate command-line arguments */  if (serverGeneration == 1 && !winValidateArgs ())    {      FatalError ("InitOutput - Invalid command-line arguments found.  "		  "Exiting./n");    }  /* Check for duplicate invocation on same display number.*/  if (serverGeneration == 1 && !winCheckDisplayNumber ())    {      if (g_fSilentDupError)        g_fSilentFatalError = TRUE;        FatalError ("InitOutput - Duplicate invocation on display "		  "number: %s.  Exiting./n", display);    }#ifdef XWIN_XF86CONFIG  /* Try to read the xorg.conf-style configuration file */  if (!winReadConfigfile ())    winErrorFVerb (1, "InitOutput - Error reading config file/n");#else  winMsg(X_INFO, "xorg.conf is not supported/n");  winMsg(X_INFO, "See http://x.cygwin.com/docs/faq/cygwin-x-faq.html "         "for more information/n");  winConfigFiles ();#endif  /* Load preferences from XWinrc file */  LoadPreferences();  /* Setup global screen info parameters */  screenInfo->imageByteOrder = IMAGE_BYTE_ORDER;  screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;  screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;  screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;  screenInfo->numPixmapFormats = NUMFORMATS;    /* Describe how we want common pixmap formats padded */  for (i = 0; i < NUMFORMATS; i++)    {      screenInfo->formats[i] = g_PixmapFormats[i];    }  /* Load pointers to DirectDraw functions */  winGetDDProcAddresses ();    /* Detect supported engines */  winDetectSupportedEngines ();  /* Load common controls library */  g_hmodCommonControls = LoadLibraryEx ("comctl32.dll", NULL, 0);  /* Load TrackMouseEvent function pointer */    g_fpTrackMouseEvent = GetProcAddress (g_hmodCommonControls,					 "_TrackMouseEvent");  if (g_fpTrackMouseEvent == NULL)    {      winErrorFVerb (1, "InitOutput - Could not get pointer to function/n"	      "/t_TrackMouseEvent in comctl32.dll.  Try installing/n"	      "/tInternet Explorer 3.0 or greater if you have not/n"	      "/talready./n");      /* Free the library since we won't need it */      FreeLibrary (g_hmodCommonControls);      g_hmodCommonControls = NULL;      /* Set function pointer to point to no operation function */      g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;    }  /* Store the instance handle */  g_hInstance = GetModuleHandle (NULL);  /* Initialize each screen */  for (i = 0; i < g_iNumScreens; ++i)    {      /* Initialize the screen */      if (-1 == AddScreen (winScreenInit, argc, argv))	{	  FatalError ("InitOutput - Couldn't add screen %d", i);	}    }#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)  /* Generate a cookie used by internal clients for authorization */  if (g_fXdmcpEnabled || g_fAuthEnabled)    winGenerateAuthorization ();//.........这里部分代码省略.........
开发者ID:OpenInkpot-archive,项目名称:iplinux-xorg-server,代码行数:101,


示例14: GetWindowsVersion

//.........这里部分代码省略.........                {                    return  OS_WIN32_WINDOWS_SEVEN_SERVER;                }#endif            }        }        if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 )        {            if ( osvi.wProductType == VER_NT_WORKSTATION )            {#ifdef  _WIN64                return OS_WIN32_WINDOWS_VISTA_64;#else                if (IsWow64())                {                    return OS_WIN32_WINDOWS_VISTA_64;                }                else                {                    return OS_WIN32_WINDOWS_VISTA;                }#endif            }            else            {#ifdef  _WIN64                return OS_WIN32_WINDOWS_SERVER_2008_64;#else                if (IsWow64())                {                    return OS_WIN32_WINDOWS_SERVER_2008_64;                }                else                {                    return  OS_WIN32_WINDOWS_SERVER_2008;                }#endif            }        }        if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )        {            SYSTEM_INFO si;            PGNSI pGNSI;            pGNSI = (PGNSI) GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo");            if (NULL != pGNSI)            {                pGNSI(&si);            }            if ( GetSystemMetrics(SM_SERVERR2) )            {                return OS_WIN32_WINDOWS_SERVER_2003_R2;            }            else if ( osvi.wProductType == VER_NT_WORKSTATION && si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)            {                return OS_WIN32_WINDOWS_XP_64;            }            else            {                return OS_WIN32_WINDOWS_SERVER_2003;            }        }        if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )        {            return OS_WIN32_WINDOWS_XP;        }        if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 )        {            return OS_WIN32_WINDOWS_2000;        }        if ( osvi.dwMajorVersion == 4 )        {            return OS_WIN32_WINDOWS_NT_4_0;        }        if ( osvi.dwMajorVersion == 3 && osvi.dwMinorVersion == 51 )        {            return OS_WIN32_WINDOWS_NT_3_51;        }        break;    case VER_PLATFORM_WIN32_WINDOWS:        if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)        {            return OS_WIN32_WINDOWS_95;        }        if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10)        {            return OS_WIN32_WINDOWS_98;        }        if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)        {            return OS_WIN32_WINDOWS_Me;        }        break;    }    return OS_ERROR;}
开发者ID:davidcl,项目名称:scilab,代码行数:101,


示例15: InitDirectInput

bool InitDirectInput( HWND hWnd ){	if( g_hDirectInputDLL == NULL )		g_hDirectInputDLL = LoadLibrary( _T( "dinput8.dll" ));	if( g_hDirectInputDLL == NULL )	{		ErrorMessage(IDS_ERR_DINOTFOUND, 0, false);	}	else if( !g_pDIHandle ) // is NULL if not yet initialized	{		HRESULT (WINAPI *lpGetDIHandle)( HINSTANCE, DWORD, REFIID, LPVOID*, LPUNKNOWN ) = NULL;		lpGetDIHandle = (HRESULT (WINAPI *)( HINSTANCE, DWORD, REFIID, LPVOID*, LPUNKNOWN ))GetProcAddress( g_hDirectInputDLL, "DirectInput8Create" );		if( lpGetDIHandle != NULL )		{			HRESULT hr;			hr = lpGetDIHandle( g_strEmuInfo.hinst, DIRECTINPUT_VERSION, 								IID_IDirectInput8, (LPVOID*)&g_pDIHandle, NULL );			if( FAILED( hr ))			{				ErrorMessage(IDS_ERR_DICREATE, 0, false);				g_pDIHandle = NULL;				FreeLibrary( g_hDirectInputDLL );				g_hDirectInputDLL = NULL;			}		}	}	return (g_pDIHandle != NULL);}
开发者ID:Anonymous2,项目名称:project64,代码行数:30,


示例16: lsys_sym

static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) {  lua_CFunction f = (lua_CFunction)GetProcAddress((HMODULE)lib, sym);  if (f == NULL) pusherror(L);  return f;}
开发者ID:cbeck88,项目名称:lua-primer,代码行数:5,


示例17: WinMain

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,                    LPSTR lpCmdLine,                    int nCmdShow ){    int argc;    /* VLC does not change the thread locale, so gettext/libintil will use the     * user default locale as reference. */    /* gettext versions 0.18-0.18.1 will use the Windows Vista locale name     * if the GETTEXT_MUI environment variable is set. If not set or if running     * on Windows 2000/XP/2003 an hard-coded language ID list is used. This     * putenv() call may become redundant with later versions of gettext. */    putenv("GETTEXT_MUI=1");#ifdef TOP_BUILDDIR    putenv("VLC_PLUGIN_PATH=Z:"TOP_BUILDDIR"/modules");    putenv("VLC_DATA_PATH=Z:"TOP_SRCDIR"/share");#endif    SetErrorMode(SEM_FAILCRITICALERRORS);    HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);    /* SetProcessDEPPolicy */    HINSTANCE h_Kernel32 = LoadLibraryW(L"kernel32.dll");    if(h_Kernel32)    {        BOOL (WINAPI * mySetProcessDEPPolicy)( DWORD dwFlags);        BOOL (WINAPI * mySetDllDirectoryA)(const char* lpPathName);# define PROCESS_DEP_ENABLE 1        mySetProcessDEPPolicy = (BOOL (WINAPI *)(DWORD))			// sunqueen modify                            GetProcAddress(h_Kernel32, "SetProcessDEPPolicy");        if(mySetProcessDEPPolicy)            mySetProcessDEPPolicy(PROCESS_DEP_ENABLE);        /* Do NOT load any library from cwd. */        mySetDllDirectoryA = (BOOL (WINAPI *)(const char *))			// sunqueen modify                            GetProcAddress(h_Kernel32, "SetDllDirectoryA");        if(mySetDllDirectoryA)            mySetDllDirectoryA("");        FreeLibrary(h_Kernel32);    }    /* Args */    wchar_t **wargv = CommandLineToArgvW (GetCommandLine (), &argc);    if (wargv == NULL)        return 1;//    char *argv[argc + 3];    char **argv = (char **)malloc((argc + 3) * sizeof(char *));			// sunqueen modify    BOOL crash_handling = TRUE;    int j = 0;    char *lang = NULL;    argv[j++] = FromWide( L"--media-library" );    argv[j++] = FromWide( L"--no-ignore-config" );    for (int i = 1; i < argc; i++)    {        if(!wcscmp(wargv[i], L"--no-crashdump"))        {            crash_handling = FALSE;            continue; /* don't give argument to libvlc */        }        if (!wcsncmp(wargv[i], L"--language", 10) )        {            if (i < argc - 1 && wcsncmp( wargv[i + 1], L"--", 2 ))                lang = FromWide (wargv[++i]);            continue;        }        argv[j++] = FromWide (wargv[i]);    }    argc = j;    argv[argc] = NULL;    LocalFree (wargv);    if(crash_handling)    {        static wchar_t path[MAX_PATH];        if( S_OK != SHGetFolderPathW( NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE,                    NULL, SHGFP_TYPE_CURRENT, path ) )            fprintf( stderr, "Can't open the vlc conf PATH/n" );        _snwprintf( path+wcslen( path ), MAX_PATH,  L"%s", L"//vlc//crashdump" );        crashdump_path = &path[0];        check_crashdump();        SetUnhandledExceptionFilter(vlc_exception_filter);    }    _setmode( STDIN_FILENO, _O_BINARY ); /* Needed for pipes */    /* */    if (!lang)    {        HKEY h_key;        if( RegOpenKeyEx( HKEY_CURRENT_USER, TEXT("Software//VideoLAN//VLC//"), 0, KEY_READ, &h_key )                == ERROR_SUCCESS )        {            TCHAR szData[256];//.........这里部分代码省略.........
开发者ID:sunqueen,项目名称:vlc-2.2.4.32-2013,代码行数:101,


示例18: RTTI_SINGLE

//----------------------------------------------------------------//void MOAIEnvironment::DetectEnvironment () {	RTTI_SINGLE ( MOAIGlobalEventSource )		#if defined( MOAI_OS_WINDOWS )			this->SetValue ( MOAI_ENV_osBrand, "Windows" );				UUID uuid;		UuidCreateSequential ( &uuid );				// For now, we'll just use the MAC address which is the last 6 bytes of the uuid.		char buf[13];		sprintf ( buf, "%02X%02X%02X%02X%02X%02X", uuid.Data4[2], uuid.Data4[3], uuid.Data4[4], uuid.Data4[5], uuid.Data4[6], uuid.Data4[7]);		this->SetValue ( MOAI_ENV_udid, buf );				char path[MAX_PATH];		//HRESULT hr = SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, path);		SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, path);		this->SetValue ( MOAI_ENV_documentDirectory, path );				const int BUFSIZE = 256;		TCHAR pszOS[BUFSIZE];		OSVERSIONINFOEX osvi;		SYSTEM_INFO si;		PGNSI pGNSI;						ZeroMemory(&si, sizeof(SYSTEM_INFO));		ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));		osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);		GetVersionEx((OSVERSIONINFO*) &osvi);				pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo");		if(NULL != pGNSI) {			pGNSI(&si);		}		else {			GetSystemInfo(&si);		}		if ( VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion > 4 ) {					strcpy ( pszOS, TEXT ( "Win" ));						if ( osvi.dwMajorVersion == 6 ) {				if ( osvi.dwMinorVersion == 1 ) {					if( osvi.wProductType == VER_NT_WORKSTATION )						strcat(pszOS, TEXT("7"));					else strcat(pszOS, TEXT("2008R2" ));				}				else if( osvi.dwMinorVersion == 0 ) {					if( osvi.wProductType == VER_NT_WORKSTATION )						strcat(pszOS, TEXT("Vista"));					else strcat(pszOS, TEXT("Server2008" ));				}			}			else if ( osvi.dwMajorVersion == 5 ) {				if (osvi.dwMinorVersion == 2) {									if( osvi.wProductType == VER_NT_WORKSTATION && si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64) {						strcat(pszOS, TEXT( "XPx64"));					}					else {						strcat(pszOS, TEXT("Server2003"));					}				}				else if ( osvi.dwMinorVersion == 1 ) {					strcat(pszOS, TEXT("XP"));									}				else if ( osvi.dwMinorVersion == 0 ) {					strcat(pszOS, TEXT("2000"));				}			}						this->SetValue ( MOAI_ENV_osVersion, pszOS );		}		else {			this->SetValue ( MOAI_ENV_osVersion, "WinUnknown" );		}			#elif defined( MOAI_OS_LINUX )			this->SetValue ( MOAI_ENV_osBrand, "Linux" );	#elif defined ( MOAI_OS_OSX )			this->SetValue ( MOAI_ENV_osBrand, "OSX" );	  #if 0 /* doesn't compile yet */		// OS Version		SInt32 majorVersion,minorVersion,bugFixVersion;		Gestalt(gestaltSystemVersionMajor, &majorVersion);		Gestalt(gestaltSystemVersionMinor, &minorVersion);		Gestalt(gestaltSystemVersionBugFix, &bugFixVersion);		char buffer[256];		sprintf(buffer, "%d.%d.%d",majorVersion,minorVersion,bugFixVersion);		this->SetValue ( MOAI_ENV_osVersion, buffer );	  #endif//.........这里部分代码省略.........
开发者ID:Inzaghi2012,项目名称:moai-dev,代码行数:101,


示例19: sizeof

/************* * DESCRIPTION:	do initializations for an instance * INPUT:			- * OUTPUT:			- *************/BOOL CTheApp::InitInstance(){    KEYGETINFO keyGetInfo;    HMODULE hKeyFile;    OSVERSIONINFO OSVersionInfo;    char szBuf[15];    OSVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);    if (!GetVersionEx(&OSVersionInfo))        return FALSE;    if (OSVersionInfo.dwMajorVersion < 4)    {        AfxMessageBox(IDS_ERR_PLATFORM);        return FALSE;    }    // This is just for setting the current working directory in rsi.dll    rsiInit();    // Standard initialization    // 3d controls and grey background    Enable3dControls();    SetDialogBkColor();    // Drag and drop support    AfxOleInit();    strcpy(szBuf, "ke");    // Load standard INI file options (including MRU)    LoadStdProfileSettings();    getcwd(szWorkingDirectory, 256);    // get user name and serial number out of keyfile    strcpy(szUserName, "");    strcat(szBuf, "yfil");    nUserSernum = 0;    strcat(szBuf, "e.dll");    hKeyFile = LoadLibrary(szBuf);    if (hKeyFile)    {        keyGetInfo = (KEYGETINFO)GetProcAddress(hKeyFile, (LPCSTR)2);        keyGetInfo(szUserName, &nUserSernum);        FreeLibrary(hKeyFile);    }    // Register document templates    CSingleDocTemplate *pDocTemplate;    pDocTemplate = new CSingleDocTemplate(IDR_MAINFRAME,                                          RUNTIME_CLASS(CDoc),                                          RUNTIME_CLASS(CMainFrame),       // main SDI frame window                                          RUNTIME_CLASS(CCamView));    AddDocTemplate(pDocTemplate);    OnFileNew();    return TRUE;}
开发者ID:privatosan,项目名称:RayStorm,代码行数:71,


示例20: DwmSetIconicLivePreviewBitmap

void DwmSetIconicLivePreviewBitmap(HWND hwnd, HBITMAP hbmp, POINT *pptClient, DWORD dwSITFlags){    HMODULE dwmapi = LoadLibrary(TEXT("dwmapi.dll"));    if (dwmapi)    {        t_DwmSetIconicLivePreviewBitmap set_live_preview = reinterpret_cast<t_DwmSetIconicLivePreviewBitmap>(GetProcAddress(dwmapi, "DwmSetIconicLivePreviewBitmap"));        set_live_preview(hwnd, hbmp, pptClient, dwSITFlags);        FreeLibrary(dwmapi);    }}
开发者ID:petroules,项目名称:petroules-utilities-qt,代码行数:11,


示例21: cpuUsageNT

//------------------------------------------------------------------// get CPU usage on NT-style operating systems//------------------------------------------------------------------DWORD cpuUsageNT(){  static SYSTEM_PERFORMANCE_INFORMATION SysPerfInfo;  static SYSTEM_TIME_INFORMATION SysTimeInfo;  static SYSTEM_BASIC_INFORMATION SysBaseInfo;  static double dbIdleTime;  static double dbSystemTime;  static LONG status;  static LARGE_INTEGER liOldIdleTime = {0,0};  static LARGE_INTEGER liOldSystemTime = {0,0};  static BOOL init = FALSE;  static PROCNTQSI NtQuerySystemInformation = NULL;  DWORD retVal = 0xffffffff;  if( !init )  {    NtQuerySystemInformation = (PROCNTQSI)GetProcAddress( GetModuleHandle(_T("ntdll")), "NtQuerySystemInformation" );    if( !NtQuerySystemInformation )      return 0xffffffff;    // get number of processors in the system    status = NtQuerySystemInformation( SystemBasicInformation, &SysBaseInfo, sizeof(SysBaseInfo), NULL );    if( status != NO_ERROR )      return 0xffffffff;    init = TRUE;  }  // get new system time  status = NtQuerySystemInformation( SystemTimeInformation, &SysTimeInfo, sizeof(SysTimeInfo), 0 );  if( status != NO_ERROR )    return 0xffffffff;  // get new CPU's idle time  status = NtQuerySystemInformation( SystemPerformanceInformation, &SysPerfInfo, sizeof(SysPerfInfo), NULL );  if( status != NO_ERROR )    return 0xffffffff;  // if it's a first call - skip it  if( liOldIdleTime.QuadPart != 0 )  {    // CurrentValue = NewValue - OldValue    dbIdleTime = Li2Double( SysPerfInfo.liIdleTime ) - Li2Double( liOldIdleTime );    dbSystemTime = Li2Double( SysTimeInfo.liKeSystemTime ) - Li2Double( liOldSystemTime );    // CurrentCpuIdle = IdleTime / SystemTime    dbIdleTime = dbIdleTime / dbSystemTime;    // CurrentCpuUsage% = 100 - (CurrentCpuIdle * 100) / NumberOfProcessors    dbIdleTime = 100.0 - dbIdleTime * 100.0 / (double)SysBaseInfo.bKeNumberProcessors + 0.5;        retVal = (DWORD)dbIdleTime;  }  // store new CPU's idle and system time  liOldIdleTime = SysPerfInfo.liIdleTime;  liOldSystemTime = SysTimeInfo.liKeSystemTime;  return retVal;}
开发者ID:savmiester,项目名称:CPU-Dominator,代码行数:65,


示例22: DwmSetWindowAttribute

void DwmSetWindowAttribute(HWND hwnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute){    HMODULE dwmapi = LoadLibrary(TEXT("dwmapi.dll"));    if (dwmapi)    {        t_DwmSetWindowAttribute set_window_attribute = reinterpret_cast<t_DwmSetWindowAttribute>(GetProcAddress(dwmapi, "DwmSetWindowAttribute"));        set_window_attribute(hwnd, dwAttribute, pvAttribute, cbAttribute);        FreeLibrary(dwmapi);    }}
开发者ID:petroules,项目名称:petroules-utilities-qt,代码行数:11,


示例23: DwmSetIconicThumbnail

void DwmSetIconicThumbnail(HWND hwnd, HBITMAP hbmp, DWORD dwSITFlags){    HMODULE dwmapi = LoadLibrary(TEXT("dwmapi.dll"));    if (dwmapi)    {        t_DwmSetIconicThumbnail set_iconic_thumbnail = reinterpret_cast<t_DwmSetIconicThumbnail>(GetProcAddress(dwmapi, "DwmSetIconicThumbnail"));        set_iconic_thumbnail(hwnd, hbmp, dwSITFlags);        FreeLibrary(dwmapi);    }}
开发者ID:petroules,项目名称:petroules-utilities-qt,代码行数:11,


示例24: DwmInvalidateIconicBitmaps

void DwmInvalidateIconicBitmaps(HWND hwnd){    HMODULE dwmapi = LoadLibrary(TEXT("dwmapi.dll"));    if (dwmapi)    {        t_DwmInvalidateIconicBitmaps invalidate_icon_bitmap = reinterpret_cast<t_DwmInvalidateIconicBitmaps>(GetProcAddress(dwmapi, "DwmInvalidateIconicBitmaps"));        invalidate_icon_bitmap(hwnd);        FreeLibrary(dwmapi);    }}
开发者ID:petroules,项目名称:petroules-utilities-qt,代码行数:11,


示例25: LoadOAL10Library

ALboolean LoadOAL10Library(char *szOALFullPathName, LPOPENALFNTABLE lpOALFnTable){	if (!lpOALFnTable)		return AL_FALSE;	if (szOALFullPathName)		g_hOpenALDLL = LoadLibrary(szOALFullPathName);	else		g_hOpenALDLL = LoadLibrary("openal32.dll");	if (!g_hOpenALDLL)		return AL_FALSE;	memset(lpOALFnTable, 0, sizeof(OPENALFNTABLE));	// Get function pointers	lpOALFnTable->alEnable = (LPALENABLE)GetProcAddress(g_hOpenALDLL, "alEnable");	if (lpOALFnTable->alEnable == NULL)	{		OutputDebugString("Failed to retrieve 'alEnable' function address/n");		return AL_FALSE;	}	lpOALFnTable->alDisable = (LPALDISABLE)GetProcAddress(g_hOpenALDLL, "alDisable");	if (lpOALFnTable->alDisable == NULL)	{		OutputDebugString("Failed to retrieve 'alDisable' function address/n");		return AL_FALSE;	}	lpOALFnTable->alIsEnabled = (LPALISENABLED)GetProcAddress(g_hOpenALDLL, "alIsEnabled");	if (lpOALFnTable->alIsEnabled == NULL)	{		OutputDebugString("Failed to retrieve 'alIsEnabled' function address/n");		return AL_FALSE;	}	lpOALFnTable->alGetBoolean = (LPALGETBOOLEAN)GetProcAddress(g_hOpenALDLL, "alGetBoolean");	if (lpOALFnTable->alGetBoolean == NULL)	{		OutputDebugString("Failed to retrieve 'alGetBoolean' function address/n");		return AL_FALSE;	}	lpOALFnTable->alGetInteger = (LPALGETINTEGER)GetProcAddress(g_hOpenALDLL, "alGetInteger");	if (lpOALFnTable->alGetInteger == NULL)	{		OutputDebugString("Failed to retrieve 'alGetInteger' function address/n");		return AL_FALSE;	}	lpOALFnTable->alGetFloat = (LPALGETFLOAT)GetProcAddress(g_hOpenALDLL, "alGetFloat");	if (lpOALFnTable->alGetFloat == NULL)	{		OutputDebugString("Failed to retrieve 'alGetFloat' function address/n");		return AL_FALSE;	}	lpOALFnTable->alGetDouble = (LPALGETDOUBLE)GetProcAddress(g_hOpenALDLL, "alGetDouble");	if (lpOALFnTable->alGetDouble == NULL)	{		OutputDebugString("Failed to retrieve 'alGetDouble' function address/n");		return AL_FALSE;	}	lpOALFnTable->alGetBooleanv = (LPALGETBOOLEANV)GetProcAddress(g_hOpenALDLL, "alGetBooleanv");	if (lpOALFnTable->alGetBooleanv == NULL)	{		OutputDebugString("Failed to retrieve 'alGetBooleanv' function address/n");		return AL_FALSE;	}	lpOALFnTable->alGetIntegerv = (LPALGETINTEGERV)GetProcAddress(g_hOpenALDLL, "alGetIntegerv");	if (lpOALFnTable->alGetIntegerv == NULL)	{		OutputDebugString("Failed to retrieve 'alGetIntegerv' function address/n");		return AL_FALSE;	}	lpOALFnTable->alGetFloatv = (LPALGETFLOATV)GetProcAddress(g_hOpenALDLL, "alGetFloatv");	if (lpOALFnTable->alGetFloatv == NULL)	{		OutputDebugString("Failed to retrieve 'alGetFloatv' function address/n");		return AL_FALSE;	}	lpOALFnTable->alGetDoublev = (LPALGETDOUBLEV)GetProcAddress(g_hOpenALDLL, "alGetDoublev");	if (lpOALFnTable->alGetDoublev == NULL)	{		OutputDebugString("Failed to retrieve 'alGetDoublev' function address/n");		return AL_FALSE;	}	lpOALFnTable->alGetString = (LPALGETSTRING)GetProcAddress(g_hOpenALDLL, "alGetString");	if (lpOALFnTable->alGetString == NULL)	{		OutputDebugString("Failed to retrieve 'alGetString' function address/n");		return AL_FALSE;	}	lpOALFnTable->alGetError = (LPALGETERROR)GetProcAddress(g_hOpenALDLL, "alGetError");	if (lpOALFnTable->alGetError == NULL)	{		OutputDebugString("Failed to retrieve 'alGetError' function address/n");		return AL_FALSE;	}	lpOALFnTable->alIsExtensionPresent = (LPALISEXTENSIONPRESENT)GetProcAddress(g_hOpenALDLL, "alIsExtensionPresent");	if (lpOALFnTable->alIsExtensionPresent == NULL)	{		OutputDebugString("Failed to retrieve 'alIsExtensionPresent' function address/n");		return AL_FALSE;	}//.........这里部分代码省略.........
开发者ID:inaes-tic,项目名称:tv-moldeo,代码行数:101,


示例26: bsc_platform_init

int bsc_platform_init(int features){#if defined(_WIN32)    if (features & LIBBSC_FEATURE_LARGEPAGES)    {        HANDLE hToken = 0;        if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))        {            LUID luid;            if (LookupPrivilegeValue(NULL, TEXT("SeLockMemoryPrivilege"), &luid))            {                TOKEN_PRIVILEGES tp;                tp.PrivilegeCount = 1;                tp.Privileges[0].Luid = luid;                tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;                AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(tp), 0, 0);            }            CloseHandle(hToken);        }        {            typedef SIZE_T (WINAPI * GetLargePageMinimumProcT)();            GetLargePageMinimumProcT largePageMinimumProc = (GetLargePageMinimumProcT)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum");            if (largePageMinimumProc != NULL)            {                SIZE_T largePageSize = largePageMinimumProc();                if ((largePageSize & (largePageSize - 1)) != 0) largePageSize = 0;                g_LargePageSize = largePageSize;            }        }    }#endif    return LIBBSC_NO_ERROR;}
开发者ID:seanjensengrey,项目名称:libbsc,代码行数:44,



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


C++ GetProcPtr函数代码示例
C++ GetProc函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。