Port Win app to Linux Questions: Memory management and OEM Char



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.

Also: LocalFree



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.

Also: GlobalFree, GlobalLock, GlobalUnlock



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.

Also: VirtualFree, VirtualLock, VirtualUnlock



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


thx!

.



Relevant Pages

  • Re: Port Win app to Linux Questions: Memory management and OEM Char
    ... > local heap and global heap. ... HGLOBAL GlobalAlloc(UINT uFlags, SIZE_T dwBytes) ... The GlobalAlloc function allocates the specified number of bytes ... The VirtualAlloc function reserves or commits a region of pages ...
    (comp.unix.programmer)
  • Re: Heap & Stack Question
    ... > the msdn tells that the default heap size is 1 MB and can be set with ... if i do an allocation: ... > this should be localized in the heap? ... Yes, it will be allocated on the stack. ...
    (microsoft.public.vc.mfc)
  • Heap & Stack Question
    ... the msdn tells that the default heap size is 1 MB and can be set with ... this should be localized in the heap? ... Nicolas H. ... Prev by Date: ...
    (microsoft.public.vc.mfc)
  • Modify heap attributes of another process?
    ... how do i modify heap attributes of another process? ... I've found from msdn ways to enumerate processes and then getting heap ...
    (microsoft.public.win32.programmer.kernel)