home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / smart21b.zip / SMARTAUX / WN32WARP / WN32WARP.DCT < prev   
Text File  |  1995-02-08  |  8KB  |  174 lines

  1. .Notice  =Database dictionary
  2. .Table   =Win32 to Warp
  3. .Version =1.0
  4. .Date    =01/19/95
  5.  
  6. .Keyword =010 020 030 TlsAlloc
  7. .SComment=Replace with DosAllocThreadLocalMemory noting differences
  8. .LComment=Replace with DosAllocThreadLocalMemory noting differences in
  9.          =the parameters passed and returned values.  TlsAlloc
  10.          =requires no parameters and returns an index of type DWORD.
  11.          =DosAllocThreadLocalMemory requires two parameters and
  12.          =returns a value which indicates success or failure.  Be sure
  13.          =to declare a new variable which will receive the returned
  14.          =value and modify, as necessary, any logic which is based on
  15.          =the returned value.  When migrating from 32-bit Windows to
  16.          =OS/2 Warp always set the first parameter in the argument
  17.          =list of DosAllocThreadLocalMemory to 1.  Note that in
  18.          =Windows the system allows a minimum of 256 bytes of
  19.          =thread-local storage throughout the system and that
  20.          =OS/2 Warp provides a maximum of 128 bytes of thread-local
  21.          =storage per process.  This means that if a Windows
  22.          =application uses more than 128 bytes of thread-local storage
  23.          =it will be necessary to redesign and rewrite the portion of
  24.          =the migrated code which manages thread-local memory so that
  25.          =it can operate within the limits of OS/2 Warp.
  26. .Sample  =Windows:
  27.          =  DWORD     TLStorage1 = TlsAlloc ();
  28.          =OS/2 Warp:
  29.          =  ULONG     TLStorage1;
  30.          =  APIRET    rc = DosAllocThreadLocalMemory (1, &TLStorage1);
  31. .Prototyp=APIRET APIENTRY DosAllocThreadLocalMemory(ULONG cb, PULONG *p);
  32. .Template=DosAllocThreadLocalMemory (1, )
  33. .Refer   =DosAllocThreadLocalMemory
  34. .Refer   =$TlsSetValue
  35. .Refer   =$TlsGetValue
  36. .Refer   =$TlsFree
  37.  
  38. .Keyword =010 010 999 TlsSetValue
  39. .SComment=Replace with a simple assignment
  40. .LComment=Replace TlsSetValue with a simple assignment; assigning its
  41.          =second parameter to be the value of its first parameter.
  42.          =Keep in mind that in the migrated code the first parameter
  43.          =will be a ULONG and the second parameter will be a pointer;
  44.          =so in the assignment it will be necessary to type-cast the
  45.          =second parameter to be a ULONG.
  46. .Sample  =Windows:
  47.          =  DWORD     TLStorage1 = TlsAlloc ();
  48.          =  LPVOID    TLMem1 = calloc (1, 200);
  49.          =  BOOL      rc = TlsSetValue (TLStorage1, TLMem1);
  50.          =  ...
  51.          =OS/2 Warp:
  52.          =  ULONG     TLStorage1;
  53.          =  APIRET    rc = DosAllocThreadLocalMemory (1, &TLStorage1);
  54.          =  LPVOID    TLMem1 = calloc (1, 200);
  55.          =  TLStorage1 = (ULONG) TLMem1;
  56.          =  ...
  57. .Command =SmRemove ('LINE')
  58.          =SmOutputLine ('$P1 = (ULONG) $P2;')
  59. .Refer   =DosAllocThreadLocalMemory
  60. .Refer   =$TlsSetValue
  61. .Refer   =$TlsGetValue
  62. .Refer   =$TlsFree
  63.  
  64. .Keyword =010 010 999 TlsGetValue
  65. .SComment=Replace with a simple assignment
  66. .LComment=Replace TlsGetValue with a simple assignment; assigning its
  67.          =parameter to be the value of its return variable.
  68.          =Keep in mind that in the migrated code the parameter will be
  69.          =a ULONG and the return value will be a pointer, so it will
  70.          =be necessary to type-cast the parameter to be a PVOID.
  71. .Sample  =Windows:
  72.          =  DWORD     TLStorage1 = TlsAlloc ();
  73.          =  LPVOID    TLMem1 = calloc (1, 200);
  74.          =  BOOL      rc = TlsSetValue (TLStorage1, TLMem1);
  75.          =  ...
  76.          =  LPVOID    TLMem2 = TlsGetValue (TLStorage1);
  77.          =  ...
  78.          =OS/2 Warp:
  79.          =  ULONG     TLStorage1;
  80.          =  APIRET    rc = DosAllocThreadLocalMemory (1, &TLStorage1);
  81.          =  LPVOID    TLMem1 = calloc (1, 200);
  82.          =  TLStorage1 = (ULONG) TLMem1;
  83.          =  ...
  84.          =  LPVOID    TLMem2 = (PVOID) TLStorage1;
  85.          =  ...
  86. .Command =SmRemove ('LINE')
  87.          =SmOutputLine ('$KRTN = (PVOID) $P1;')
  88. .Refer   =DosAllocThreadLocalMemory
  89. .Refer   =$TlsSetValue
  90. .Refer   =$TlsGetValue
  91. .Refer   =$TlsFree
  92.  
  93. .Keyword =010 020 030 TlsFree
  94. .SComment=Replace with DosFreeThreadLocalMemory noting differences
  95. .LComment=Replace with DosFreeThreadLocalMemory noting differences in
  96.          =the parameter passed and returned values.  TlsFree requires
  97.          =that a variable of type DWORD be passed in which is an index
  98.          =to thread-local storage allocated for that thread by a call to
  99.          =TlsAlloc.  DosFreeThreadLocalMemory requires a pointer to
  100.          =thread-local memory allocated for that thread by a call to
  101.          =DosAllocThreadLocalMemory.  TlsFree returns 1 in order to
  102.          =indicate success and returns 0 in order to indicate an error
  103.          =condition.   DosFreeThreadLocalMemory returns 0 in order to
  104.          =indicate success, and any other value indicates an error.  If
  105.          =you use the migration provided in the template then no other
  106.          =changes should be required.  Otherwise, be sure to modify any
  107.          =code which is dependent upon the return value because of these
  108.          =differences.
  109. .Sample  =Windows:
  110.          =  DWORD     TLStorage1 = TlsAlloc ();
  111.          =  LPVOID    TLMem1 = calloc (1, 200);
  112.          =  BOOL      rc = TlsSetValue (TLStorage1, TLMem1);
  113.          =  ...
  114.          =  LPVOID    TLMem2 = TlsGetValue (TLStorage1);
  115.          =  free (TLMem1);
  116.          =  rc = TlsFree (TLStorage1);
  117.          =  ...
  118.          =OS/2 Warp:
  119.          =  ULONG     TLStorage1;
  120.          =  APIRET    rc = DosAllocThreadLocalMemory (1, &TLStorage1);
  121.          =  LPVOID    TLMem1 = calloc (1, 200);
  122.          =  TLStorage1 = (ULONG) TLMem1;
  123.          =  ...
  124.          =  LPVOID    TLMem2 = (PVOID) TLStorage1;
  125.          =  free (TLMem1);
  126.          =  rc = DosFreeThreadLocalMemory (&TLStorage1);
  127.          =  ...
  128. .Prototyp=APIRET APIENTRY DosFreeThreadLocalMemory (ULONG *p);
  129. .Template=(DosFreeThreadLocalMemory (&$P1) == 0)
  130. .Command =SmMigrateKeyword ($T1)
  131. .Refer   =DosAllocThreadLocalMemory
  132. .Refer   =$TlsSetValue
  133. .Refer   =$TlsGetValue
  134. .Refer   =$TlsFree
  135.  
  136. .Keyword =010 030 370 RectVisible
  137. .SComment=Replace with WinQueryVisibleRegion and GpiRectInRegion
  138. .LComment=First call WinQueryVisibleRegion which will provide a handle
  139.          =to the visible region of the window whose handle is specified
  140.          =in the argument list.  This window handle will replace the
  141.          =device context handle passed to RectVisible.  The region
  142.          =handle returned should then be passed to GpiRectInRegion along
  143.          =with a presentation space handle and the pointer to the
  144.          =rectangle originally passed in to RectVisible.  The value
  145.          =returned by GpiRectInRegion will indicate whether the
  146.          =specified rectangle is in the window's visible region.  Note
  147.          =the difference in return codes between the Windows call and
  148.          =the OS/2 call and modoify your logic accordingly.  Also notice
  149.          =the different data types for the return values and rectangle
  150.          =structure between RectVisible and GpiRectInRegion.
  151. .Sample  =Windows:
  152.          =  BOOL         bRC;
  153.          =  HDC          hdc;
  154.          =  RECT         Rect;
  155.          =...
  156.          =  bRC = RectVisible (hdc, &Rect);
  157.          =OS/2 Warp:
  158.          =  HWND         hwnd;
  159.          =  HRGN         hrgn;
  160.          =  LONG         lInside;
  161.          =  HPS          hps;
  162.          =  RECTL        lRect;
  163.          =...
  164.          =  WinQueryVisibleRegion (hwnd, hrgn);
  165.          =  lInside = GpiRectInRegion (hps, hrgn, &lRect);
  166. .Prototyp=ULONG APIENTRY WinQueryVisibleRegion ( HWND hwnd, HRGN hrgn);
  167.          =LONG  APIENTRY GpiRectInRegion (HPS hps, HRGN hrgn,
  168.          =                               PRECTL prclRect);
  169. .Template=WinQueryVisibleRegion ( , )
  170.          =GpiRectInRegion ( , , )
  171. .Refer   =WinQueryVisibleRegion
  172. .Refer   =GpiRectInRegion
  173. .Refer   =RectVisible
  174.