home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
smart21b.zip
/
SMARTAUX
/
WN32WARP
/
WN32WARP.DCT
< prev
Wrap
Text File
|
1995-02-08
|
8KB
|
174 lines
.Notice =Database dictionary
.Table =Win32 to Warp
.Version =1.0
.Date =01/19/95
.Keyword =010 020 030 TlsAlloc
.SComment=Replace with DosAllocThreadLocalMemory noting differences
.LComment=Replace with DosAllocThreadLocalMemory noting differences in
=the parameters passed and returned values. TlsAlloc
=requires no parameters and returns an index of type DWORD.
=DosAllocThreadLocalMemory requires two parameters and
=returns a value which indicates success or failure. Be sure
=to declare a new variable which will receive the returned
=value and modify, as necessary, any logic which is based on
=the returned value. When migrating from 32-bit Windows to
=OS/2 Warp always set the first parameter in the argument
=list of DosAllocThreadLocalMemory to 1. Note that in
=Windows the system allows a minimum of 256 bytes of
=thread-local storage throughout the system and that
=OS/2 Warp provides a maximum of 128 bytes of thread-local
=storage per process. This means that if a Windows
=application uses more than 128 bytes of thread-local storage
=it will be necessary to redesign and rewrite the portion of
=the migrated code which manages thread-local memory so that
=it can operate within the limits of OS/2 Warp.
.Sample =Windows:
= DWORD TLStorage1 = TlsAlloc ();
=OS/2 Warp:
= ULONG TLStorage1;
= APIRET rc = DosAllocThreadLocalMemory (1, &TLStorage1);
.Prototyp=APIRET APIENTRY DosAllocThreadLocalMemory(ULONG cb, PULONG *p);
.Template=DosAllocThreadLocalMemory (1, )
.Refer =DosAllocThreadLocalMemory
.Refer =$TlsSetValue
.Refer =$TlsGetValue
.Refer =$TlsFree
.Keyword =010 010 999 TlsSetValue
.SComment=Replace with a simple assignment
.LComment=Replace TlsSetValue with a simple assignment; assigning its
=second parameter to be the value of its first parameter.
=Keep in mind that in the migrated code the first parameter
=will be a ULONG and the second parameter will be a pointer;
=so in the assignment it will be necessary to type-cast the
=second parameter to be a ULONG.
.Sample =Windows:
= DWORD TLStorage1 = TlsAlloc ();
= LPVOID TLMem1 = calloc (1, 200);
= BOOL rc = TlsSetValue (TLStorage1, TLMem1);
= ...
=OS/2 Warp:
= ULONG TLStorage1;
= APIRET rc = DosAllocThreadLocalMemory (1, &TLStorage1);
= LPVOID TLMem1 = calloc (1, 200);
= TLStorage1 = (ULONG) TLMem1;
= ...
.Command =SmRemove ('LINE')
=SmOutputLine ('$P1 = (ULONG) $P2;')
.Refer =DosAllocThreadLocalMemory
.Refer =$TlsSetValue
.Refer =$TlsGetValue
.Refer =$TlsFree
.Keyword =010 010 999 TlsGetValue
.SComment=Replace with a simple assignment
.LComment=Replace TlsGetValue with a simple assignment; assigning its
=parameter to be the value of its return variable.
=Keep in mind that in the migrated code the parameter will be
=a ULONG and the return value will be a pointer, so it will
=be necessary to type-cast the parameter to be a PVOID.
.Sample =Windows:
= DWORD TLStorage1 = TlsAlloc ();
= LPVOID TLMem1 = calloc (1, 200);
= BOOL rc = TlsSetValue (TLStorage1, TLMem1);
= ...
= LPVOID TLMem2 = TlsGetValue (TLStorage1);
= ...
=OS/2 Warp:
= ULONG TLStorage1;
= APIRET rc = DosAllocThreadLocalMemory (1, &TLStorage1);
= LPVOID TLMem1 = calloc (1, 200);
= TLStorage1 = (ULONG) TLMem1;
= ...
= LPVOID TLMem2 = (PVOID) TLStorage1;
= ...
.Command =SmRemove ('LINE')
=SmOutputLine ('$KRTN = (PVOID) $P1;')
.Refer =DosAllocThreadLocalMemory
.Refer =$TlsSetValue
.Refer =$TlsGetValue
.Refer =$TlsFree
.Keyword =010 020 030 TlsFree
.SComment=Replace with DosFreeThreadLocalMemory noting differences
.LComment=Replace with DosFreeThreadLocalMemory noting differences in
=the parameter passed and returned values. TlsFree requires
=that a variable of type DWORD be passed in which is an index
=to thread-local storage allocated for that thread by a call to
=TlsAlloc. DosFreeThreadLocalMemory requires a pointer to
=thread-local memory allocated for that thread by a call to
=DosAllocThreadLocalMemory. TlsFree returns 1 in order to
=indicate success and returns 0 in order to indicate an error
=condition. DosFreeThreadLocalMemory returns 0 in order to
=indicate success, and any other value indicates an error. If
=you use the migration provided in the template then no other
=changes should be required. Otherwise, be sure to modify any
=code which is dependent upon the return value because of these
=differences.
.Sample =Windows:
= DWORD TLStorage1 = TlsAlloc ();
= LPVOID TLMem1 = calloc (1, 200);
= BOOL rc = TlsSetValue (TLStorage1, TLMem1);
= ...
= LPVOID TLMem2 = TlsGetValue (TLStorage1);
= free (TLMem1);
= rc = TlsFree (TLStorage1);
= ...
=OS/2 Warp:
= ULONG TLStorage1;
= APIRET rc = DosAllocThreadLocalMemory (1, &TLStorage1);
= LPVOID TLMem1 = calloc (1, 200);
= TLStorage1 = (ULONG) TLMem1;
= ...
= LPVOID TLMem2 = (PVOID) TLStorage1;
= free (TLMem1);
= rc = DosFreeThreadLocalMemory (&TLStorage1);
= ...
.Prototyp=APIRET APIENTRY DosFreeThreadLocalMemory (ULONG *p);
.Template=(DosFreeThreadLocalMemory (&$P1) == 0)
.Command =SmMigrateKeyword ($T1)
.Refer =DosAllocThreadLocalMemory
.Refer =$TlsSetValue
.Refer =$TlsGetValue
.Refer =$TlsFree
.Keyword =010 030 370 RectVisible
.SComment=Replace with WinQueryVisibleRegion and GpiRectInRegion
.LComment=First call WinQueryVisibleRegion which will provide a handle
=to the visible region of the window whose handle is specified
=in the argument list. This window handle will replace the
=device context handle passed to RectVisible. The region
=handle returned should then be passed to GpiRectInRegion along
=with a presentation space handle and the pointer to the
=rectangle originally passed in to RectVisible. The value
=returned by GpiRectInRegion will indicate whether the
=specified rectangle is in the window's visible region. Note
=the difference in return codes between the Windows call and
=the OS/2 call and modoify your logic accordingly. Also notice
=the different data types for the return values and rectangle
=structure between RectVisible and GpiRectInRegion.
.Sample =Windows:
= BOOL bRC;
= HDC hdc;
= RECT Rect;
=...
= bRC = RectVisible (hdc, &Rect);
=OS/2 Warp:
= HWND hwnd;
= HRGN hrgn;
= LONG lInside;
= HPS hps;
= RECTL lRect;
=...
= WinQueryVisibleRegion (hwnd, hrgn);
= lInside = GpiRectInRegion (hps, hrgn, &lRect);
.Prototyp=ULONG APIENTRY WinQueryVisibleRegion ( HWND hwnd, HRGN hrgn);
=LONG APIENTRY GpiRectInRegion (HPS hps, HRGN hrgn,
= PRECTL prclRect);
.Template=WinQueryVisibleRegion ( , )
=GpiRectInRegion ( , , )
.Refer =WinQueryVisibleRegion
.Refer =GpiRectInRegion
.Refer =RectVisible