01-14-06 03:41 AM
"vansky" <huangms_van@hotmail.com> writes:
> Dear all,
>
> im porting a WIN APP to LINUX, and face some problems that r hard for
> me to solve, could u dear guys give me some hands?
>
> i'd like to reimplement the following funcs or replace them with other
> ways , but i have no idea how to !!
>
> 1. HLOCAL LocalAlloc( UINT uFlags, SIZE_T uBytes)
>
> MSDN: The LocalAlloc function allocates the specified number of bytes
> from the heap. Windows memory management does not provide a separate
> local heap and global heap.
malloc()
> Also: LocalFree
free()
> 2. HGLOBAL GlobalAlloc( UINT uFlags, SIZE_T dwBytes)
>
> MSDN: The GlobalAlloc function allocates the specified number of bytes
> from the heap. Windows memory management does not provide a separate
> local heap and global heap.
malloc()
> Also: GlobalFree,
free()
> GlobalLock, GlobalUnlock
noop
> 3. LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize,DWORD
> flAllocationType, DWORD flProtect )
>
> MSDN: The VirtualAlloc function reserves or commits a region of pages
> in the virtual address space of the calling process. Memory allocated
> by this function is automatically initialized to zero, unless MEM_RESET
> is specified.
mmap() with MAP_ANONYMOUS
> Also: VirtualFree,
munmap()
> VirtualLock, VirtualUnlock
noop
> 4. BOOL AnsiToOem( LPCSTR lpszSrc,LPSTR lpszDst)
>
> MSDN: Converts all the characters in this CStringT object from the ANSI
> character set to the OEM character set.
>
> Also: OemToAnsi, AnsiToOemBuff
iconv()
--
Måns Rullgård
mru@inprovide.com
[ Post a follow-up to this message ]
|