home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / MAPIVAL.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  16KB  |  526 lines

  1. /*
  2.  *  M A P I V A L . H
  3.  *  
  4.  *  Macros used to validate parameters on standard MAPI object methods.
  5.  *  Used in conjunction with routines found in MAPIU.DLL.
  6.  *  
  7.  *  Copyright 1993-1995 Microsoft Corporation. All Rights Reserved.
  8.  */
  9.  
  10. #ifndef _INC_VALIDATE
  11. #define _INC_VALIDATE
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16.  
  17. #ifndef MAPIUTIL_H
  18. #include    <mapiutil.h>
  19. #endif
  20. #include    <stddef.h>
  21.  
  22.  
  23. #define MAKE_ENUM(Method, Interface)    Interface##_##Method
  24.  
  25. typedef enum _tagMethods
  26. {
  27. /* IUnknown */
  28.     MAKE_ENUM(QueryInterface, IUnknown) = 0,
  29.     MAKE_ENUM(AddRef, IUnknown),            /* For completness */
  30.     MAKE_ENUM(Release, IUnknown),           /* For completness */
  31.     
  32. /* IMAPIProps */
  33.     MAKE_ENUM(GetLastError, IMAPIProp),
  34.     MAKE_ENUM(SaveChanges, IMAPIProp),
  35.     MAKE_ENUM(GetProps, IMAPIProp),
  36.     MAKE_ENUM(GetPropList, IMAPIProp),
  37.     MAKE_ENUM(OpenProperty, IMAPIProp),
  38.     MAKE_ENUM(SetProps, IMAPIProp),
  39.     MAKE_ENUM(DeleteProps, IMAPIProp),
  40.     MAKE_ENUM(CopyTo, IMAPIProp),
  41.     MAKE_ENUM(CopyProps, IMAPIProp),
  42.     MAKE_ENUM(GetNamesFromIDs, IMAPIProp),
  43.     MAKE_ENUM(GetIDsFromNames, IMAPIProp),
  44.  
  45. /* IMAPITable */
  46.     MAKE_ENUM(GetLastError, IMAPITable),
  47.     MAKE_ENUM(Advise, IMAPITable),
  48.     MAKE_ENUM(Unadvise, IMAPITable),
  49.     MAKE_ENUM(GetStatus, IMAPITable),
  50.     MAKE_ENUM(SetColumns, IMAPITable),
  51.     MAKE_ENUM(QueryColumns, IMAPITable),
  52.     MAKE_ENUM(GetRowCount, IMAPITable),
  53.     MAKE_ENUM(SeekRow, IMAPITable),
  54.     MAKE_ENUM(SeekRowApprox, IMAPITable),
  55.     MAKE_ENUM(QueryPosition, IMAPITable),
  56.     MAKE_ENUM(FindRow, IMAPITable),
  57.     MAKE_ENUM(Restrict, IMAPITable),
  58.     MAKE_ENUM(CreateBookmark, IMAPITable),
  59.     MAKE_ENUM(FreeBookmark, IMAPITable),
  60.     MAKE_ENUM(SortTable, IMAPITable),
  61.     MAKE_ENUM(QuerySortOrder, IMAPITable),
  62.     MAKE_ENUM(QueryRows, IMAPITable),
  63.     MAKE_ENUM(Abort, IMAPITable),
  64.     MAKE_ENUM(ExpandRow, IMAPITable),
  65.     MAKE_ENUM(CollapseRow, IMAPITable),
  66.     MAKE_ENUM(WaitForCompletion, IMAPITable),
  67.     MAKE_ENUM(GetCollapseState, IMAPITable),
  68.     MAKE_ENUM(SetCollapseState, IMAPITable),
  69.  
  70. /* IMAPIContainer */
  71.     MAKE_ENUM(GetContentsTable, IMAPIContainer),
  72.     MAKE_ENUM(GetHierarchyTable, IMAPIContainer),
  73.     MAKE_ENUM(OpenEntry, IMAPIContainer),
  74.     MAKE_ENUM(SetSearchCriteria, IMAPIContainer),
  75.     MAKE_ENUM(GetSearchCriteria, IMAPIContainer),
  76.  
  77. /* IABContainer */
  78.     MAKE_ENUM(CreateEntry, IABContainer),
  79.     MAKE_ENUM(CopyEntries, IABContainer),
  80.     MAKE_ENUM(DeleteEntries, IABContainer),
  81.     MAKE_ENUM(ResolveNames, IABContainer),
  82.  
  83. /* IDistList */
  84.     MAKE_ENUM(CreateEntry, IDistList),
  85.     MAKE_ENUM(CopyEntries, IDistList),
  86.     MAKE_ENUM(DeleteEntries, IDistList),
  87.     MAKE_ENUM(ResolveNames, IDistList),
  88.  
  89. /* IMAPIFolder */
  90.     MAKE_ENUM(CreateMessage, IMAPIFolder),
  91.     MAKE_ENUM(CopyMessages, IMAPIFolder),
  92.     MAKE_ENUM(DeleteMessages, IMAPIFolder),
  93.     MAKE_ENUM(CreateFolder, IMAPIFolder),
  94.     MAKE_ENUM(CopyFolder, IMAPIFolder),
  95.     MAKE_ENUM(DeleteFolder, IMAPIFolder),
  96.     MAKE_ENUM(SetReadFlags, IMAPIFolder),
  97.     MAKE_ENUM(GetMessageStatus, IMAPIFolder),
  98.     MAKE_ENUM(SetMessageStatus, IMAPIFolder),
  99.     MAKE_ENUM(SaveContentsSort, IMAPIFolder),
  100.     MAKE_ENUM(EmptyFolder, IMAPIFolder),
  101.  
  102. /* IMsgStore */
  103.     MAKE_ENUM(Advise, IMsgStore),
  104.     MAKE_ENUM(Unadvise, IMsgStore),
  105.     MAKE_ENUM(CompareEntryIDs, IMsgStore),
  106.     MAKE_ENUM(OpenEntry, IMsgStore),
  107.     MAKE_ENUM(SetReceiveFolder, IMsgStore),
  108.     MAKE_ENUM(GetReceiveFolder, IMsgStore),
  109.     MAKE_ENUM(GetReceiveFolderTable, IMsgStore),
  110.     MAKE_ENUM(StoreLogoff, IMsgStore),
  111.     MAKE_ENUM(AbortSubmit, IMsgStore),
  112.     MAKE_ENUM(GetOutgoingQueue, IMsgStore),
  113.     MAKE_ENUM(SetLockState, IMsgStore),
  114.     MAKE_ENUM(FinishedMsg, IMsgStore),
  115.     MAKE_ENUM(NotifyNewMail, IMsgStore),
  116.  
  117. /* IMessage */
  118.     MAKE_ENUM(GetAttachmentTable, IMessage),
  119.     MAKE_ENUM(OpenAttach, IMessage),
  120.     MAKE_ENUM(CreateAttach, IMessage),
  121.     MAKE_ENUM(DeleteAttach, IMessage),
  122.     MAKE_ENUM(GetRecipientTable, IMessage),
  123.     MAKE_ENUM(ModifyRecipients, IMessage),
  124.     MAKE_ENUM(SubmitMessage, IMessage),
  125.     MAKE_ENUM(SetReadFlag, IMessage),
  126.  
  127.  
  128. /* IABProvider */
  129.     MAKE_ENUM(Shutdown, IABProvider),
  130.     MAKE_ENUM(Logon, IABProvider),
  131.  
  132. /* IABLogon */
  133.     MAKE_ENUM(GetLastError, IABLogon),
  134.     MAKE_ENUM(Logoff, IABLogon),
  135.     MAKE_ENUM(OpenEntry, IABLogon),
  136.     MAKE_ENUM(CompareEntryIDs, IABLogon),
  137.     MAKE_ENUM(Advise, IABLogon),
  138.     MAKE_ENUM(Unadvise, IABLogon),
  139.     MAKE_ENUM(OpenStatusEntry, IABLogon),
  140.     MAKE_ENUM(OpenTemplateID, IABLogon),
  141.     MAKE_ENUM(GetOneOffTable, IABLogon),
  142.     MAKE_ENUM(PrepareRecips, IABLogon),
  143.  
  144. /* IXPProvider */
  145.     MAKE_ENUM(Shutdown, IXPProvider),
  146.     MAKE_ENUM(TransportLogon, IXPProvider),
  147.  
  148. /* IXPLogon */
  149.     MAKE_ENUM(AddressTypes, IXPLogon),
  150.     MAKE_ENUM(RegisterOptions, IXPLogon),
  151.     MAKE_ENUM(TransportNotify, IXPLogon),
  152.     MAKE_ENUM(Idle, IXPLogon),
  153.     MAKE_ENUM(TransportLogoff, IXPLogon),
  154.     MAKE_ENUM(SubmitMessage, IXPLogon),
  155.     MAKE_ENUM(EndMessage, IXPLogon),
  156.     MAKE_ENUM(Poll, IXPLogon),
  157.     MAKE_ENUM(StartMessage, IXPLogon),
  158.     MAKE_ENUM(OpenStatusEntry, IXPLogon),
  159.     MAKE_ENUM(ValidateState, IXPLogon),
  160.     MAKE_ENUM(FlushQueues, IXPLogon),
  161.  
  162. /* IMSProvider */
  163.     MAKE_ENUM(Shutdown, IMSProvider),
  164.     MAKE_ENUM(Logon, IMSProvider),
  165.     MAKE_ENUM(SpoolerLogon, IMSProvider),
  166.     MAKE_ENUM(CompareStoreIDs, IMSProvider),
  167.  
  168. /* IMSLogon */
  169.     MAKE_ENUM(GetLastError, IMSLogon),
  170.     MAKE_ENUM(Logoff, IMSLogon),
  171.     MAKE_ENUM(OpenEntry, IMSLogon),
  172.     MAKE_ENUM(CompareEntryIDs, IMSLogon),
  173.     MAKE_ENUM(Advise, IMSLogon),
  174.     MAKE_ENUM(Unadvise, IMSLogon),
  175.     MAKE_ENUM(OpenStatusEntry, IMSLogon),
  176.     
  177. /* IMAPIControl */
  178.     MAKE_ENUM(GetLastError, IMAPIControl),
  179.     MAKE_ENUM(Activate, IMAPIControl),
  180.     MAKE_ENUM(GetState, IMAPIControl),
  181.     
  182. /* IMAPIStatus */
  183.     MAKE_ENUM(ValidateState, IMAPIStatus),
  184.     MAKE_ENUM(SettingsDialog, IMAPIStatus),
  185.     MAKE_ENUM(ChangePassword, IMAPIStatus),
  186.     MAKE_ENUM(FlushQueues, IMAPIStatus),
  187.  
  188. /* IStream */
  189.     MAKE_ENUM(Read, IStream),
  190.     MAKE_ENUM(Write, IStream),
  191.     MAKE_ENUM(Seek, IStream),
  192.     MAKE_ENUM(SetSize, IStream),
  193.     MAKE_ENUM(CopyTo, IStream),
  194.     MAKE_ENUM(Commit, IStream),
  195.     MAKE_ENUM(Revert, IStream),
  196.     MAKE_ENUM(LockRegion, IStream),
  197.     MAKE_ENUM(UnlockRegion, IStream),
  198.     MAKE_ENUM(Stat, IStream),
  199.     MAKE_ENUM(Clone, IStream),
  200.  
  201. /* IMAPIAdviseSink */
  202.     MAKE_ENUM(OnNotify, IMAPIAdviseSink),
  203.  
  204. } METHODS;
  205.  
  206.  
  207.  
  208. /* Macro wrappers to hide the Validate function return handling */
  209. #ifdef __cplusplus
  210.  
  211. /* C++ methods can't take the address of the This pointer, so we must
  212.    use the first parameter instead */
  213.  
  214. #define ValidateParameters(eMethod, First)              \
  215.         {   HRESULT   hr;                               \
  216.             hr = __CPPValidateParameters(eMethod, (LPVOID) &First); \
  217.             if (HR_FAILED(hr)) return (hr); }
  218.  
  219. #define UlValidateParameters(eMethod, First)                \
  220.         {   HRESULT   hr;                               \
  221.             hr = __CPPValidateParameters(eMethod, &First);  \
  222.             if (HR_FAILED(hr)) return (ULONG) (hr); }
  223.  
  224. /* Methods called by MAPI should have correct parameters
  225.    - just assert in Debug to check */
  226. #define CheckParameters(eMethod, First)             \
  227.         AssertSz(HR_SUCCEEDED(__CPPValidateParameters(eMethod, &First)), "Parameter validation failed for method called by MAPI!")
  228.  
  229.  
  230. #else /* __cplusplus */
  231.  
  232. /* For methods that will be called by clients 
  233.    - validate always */
  234.    
  235. #define ValidateParameters(eMethod, ppThis)             \
  236.         {   HRESULT   hr;                               \
  237.             hr = __ValidateParameters(eMethod, ppThis); \
  238.             if (HR_FAILED(hr)) return (hr); }
  239.  
  240. #define UlValidateParameters(eMethod, ppThis)               \
  241.         {   HRESULT   hr;                               \
  242.             hr = __ValidateParameters(eMethod, ppThis); \
  243.             if (HR_FAILED(hr)) return (ULONG) (hr); }
  244.  
  245. /* Methods called by MAPI should have correct parameters
  246.    - just assert in Debug to check */
  247. #define CheckParameters(eMethod, ppThis)                \
  248.         AssertSz(HR_SUCCEEDED(__ValidateParameters(eMethod, ppThis)), "Parameter validation failed for method called by MAPI!")
  249.  
  250. #endif /* __cplusplus */
  251.  
  252. /* Prototypes for functions used to validate complex parameters.
  253.  */
  254. #define FBadPropVal( lpPropVal) (FAILED(ScCountProps( 1, lpPropVal, NULL)))
  255.  
  256. #define FBadRgPropVal( lpPropVal, cValues) \
  257.         (FAILED(ScCountProps( cValues, lpPropVal, NULL)))
  258.  
  259. #define FBadAdrList( lpAdrList) \
  260.         (   AssertSz(   (   offsetof( ADRLIST, cEntries) \
  261.                          == offsetof( SRowSet, cRows)) \
  262.                      && (   offsetof( ADRLIST, aEntries) \
  263.                          == offsetof( SRowSet, aRow)) \
  264.                      && (   offsetof( ADRENTRY, cValues) \
  265.                          == offsetof( SRow, cValues)) \
  266.                      && (   offsetof( ADRENTRY, rgPropVals) \
  267.                          == offsetof( SRow, lpProps)) \
  268.                     , "ADRLIST doesn't match SRowSet") \
  269.          || FBadRowSet( (LPSRowSet) lpAdrList))
  270.  
  271. STDAPI_(BOOL)
  272. FBadRglpszW( LPWSTR FAR *lppszW,
  273.              ULONG      cStrings);
  274.  
  275. STDAPI_(BOOL)
  276. FBadRowSet( LPSRowSet   lpRowSet);
  277.  
  278. STDAPI_(BOOL)
  279. FBadRglpNameID( LPMAPINAMEID FAR *  lppNameId,
  280.                 ULONG               cNames);
  281.  
  282. STDAPI_(BOOL)
  283. FBadEntryList( LPENTRYLIST  lpEntryList);
  284.  
  285.  
  286. /* BAD_STANDARD_OBJ
  287.  *
  288.  * This macro insures that the object is a writable object of the correct size
  289.  * and that this method belongs to the object.
  290.  *
  291.  * NOTES ON USE!
  292.  *  This depends upon using the standard method of declaring the object
  293.  *  interface.
  294.  *
  295.  *  prefix is the method prefix you chose when declaring the object interface.
  296.  *  method is the standard method name of the calling method.
  297.  *  lpVtbl is the name of the lpVtbl element of your object.
  298.  */
  299. #define BAD_STANDARD_OBJ( lpObj, prefix, method, lpVtbl) \
  300.     (   IsBadWritePtr( (lpObj), sizeof(*lpObj)) \
  301.      || IsBadReadPtr( (void *) &(lpObj->lpVtbl->method), sizeof(LPVOID)) \
  302.      || ((LPVOID) (lpObj->lpVtbl->method) != (LPVOID) (prefix##method)))
  303.  
  304.  
  305. #define FBadUnknown( lpObj ) \
  306.     (   IsBadReadPtr( (lpObj), sizeof(LPVOID) ) \
  307.      || IsBadReadPtr( (lpObj)->lpVtbl, 3 * sizeof(LPUNKNOWN) ) \
  308.      || IsBadCodePtr( (FARPROC)(lpObj)->lpVtbl->QueryInterface ))
  309.  
  310. /*
  311.  * IUnknown
  312.  */
  313.  
  314.  
  315. /*
  316.  * QueryInterface
  317.  */
  318. #define FBadQueryInterface( lpObj, riid, ppvObj)    \
  319.     (   IsBadReadPtr( riid, sizeof(IID)) \
  320.      || IsBadWritePtr( ppvObj, sizeof(LPVOID)))
  321.  
  322.  
  323. /*
  324.  * AddRef
  325.  *  No parameter validation required.
  326.  */
  327. #define FBadAddRef( lpObj)  FALSE
  328.  
  329.  
  330. /*
  331.  * Release
  332.  *  No parameter validation required.
  333.  */
  334. #define FBadRelease( lpObj) FALSE
  335.  
  336.  
  337. /*
  338.  * GetLastError
  339.  */
  340. #define FBadGetLastError( lpObj, hResult, ulFlags, lppMAPIError )\
  341.     (IsBadWritePtr( lppMAPIError, sizeof(LPMAPIERROR)))
  342.  
  343. /*
  344.  * IMAPIProp
  345.  */
  346.  
  347.  
  348. /*
  349.  * SaveChanges
  350.  *  No parameter validation required.
  351.  */
  352. #define FBadSaveChanges( lpObj, ulFlags)    FALSE
  353.  
  354.  
  355. /*
  356.  * GetProps
  357.  */
  358. #define FBadGetProps( lpObj, lpPTagA, lpcValues, lppPropArray) \
  359.     (   (   lpPTagA \
  360.          && (   IsBadReadPtr( lpPTagA, sizeof(ULONG)) \
  361.              || IsBadReadPtr( lpPTagA, (UINT)(  (lpPTagA->cValues + 1) \
  362.                                               * sizeof(ULONG))))) \
  363.      || IsBadWritePtr( lpcValues, sizeof(ULONG)) \
  364.      || IsBadWritePtr( lppPropArray, sizeof(LPSPropValue)))
  365.  
  366.  
  367. /*
  368.  * GetPropList
  369.  */
  370. #define FBadGetPropList( lpObj, lppPTagA) \
  371.     (IsBadWritePtr( lppPTagA, sizeof(LPSPropTagArray FAR *)))
  372.  
  373.  
  374. /*
  375.  * OpenProperty
  376.  */
  377. #define FBadOpenProperty( lpObj, ulPropTag, lpiid, ulInterfaceOptions, ulFlags \
  378.                         , lppUnk) \
  379.     (   IsBadReadPtr( lpiid, sizeof(IID)) \
  380.      || IsBadWritePtr( lppUnk, sizeof (LPUNKNOWN FAR *)))
  381.  
  382.  
  383. /*
  384.  * SetProps
  385.  */
  386. #define FBadSetProps( lpObj, cValues, lpPropArray, lppProblems) \
  387.     (   FBadRgPropVal( lpPropArray, (UINT) cValues) \
  388.      || (   lppProblems \
  389.          && IsBadWritePtr( lppProblems, sizeof(LPSPropProblemArray))))
  390.  
  391.  
  392. /*
  393.  * DeleteProps
  394.  */
  395. #define FBadDeleteProps( lpObj, lpPTagA, lppProblems) \
  396.     (   (   !lpPTagA \
  397.          || (   IsBadReadPtr( lpPTagA, sizeof(ULONG)) \
  398.              || IsBadReadPtr( lpPTagA, (UINT)(  (lpPTagA->cValues + 1) \
  399.                                               * sizeof(ULONG))))) \
  400.      || (   lppProblems \
  401.          && IsBadWritePtr( lppProblems, sizeof(LPSPropProblemArray))))
  402.  
  403.  
  404. /*
  405.  * CopyTo
  406.  */
  407. #define FBadCopyTo( lpIPDAT, ciidExclude, rgiidExclude, lpExcludeProps \
  408.                   , ulUIParam, lpProgress, lpInterface, lpDestObj \
  409.                   , ulFlags, lppProblems) \
  410.     (   (   ciidExclude \
  411.          && (  IsBadReadPtr( rgiidExclude, (UINT)(ciidExclude * sizeof(IID))))) \
  412.      || (   lpExcludeProps \
  413.          && (   IsBadReadPtr( lpExcludeProps, sizeof(ULONG)) \
  414.              || IsBadReadPtr( lpExcludeProps \
  415.                             , (UINT)(  (lpExcludeProps->cValues + 1) \
  416.                                      * sizeof(ULONG))))) \
  417.      || (lpProgress && FBadUnknown( lpProgress )) \
  418.      || (lpInterface && IsBadReadPtr( lpInterface, sizeof(IID))) \
  419.      || IsBadReadPtr( lpDestObj, sizeof(LPVOID)) \
  420.      || (   lppProblems \
  421.          && IsBadWritePtr( lppProblems, sizeof(LPSPropProblemArray))))
  422.  
  423.  
  424. /*
  425.  * CopyProps
  426.  */
  427. #define FBadCopyProps( lpIPDAT, lpPropTagArray \
  428.                      , ulUIParam, lpProgress, lpInterface, lpDestObj \
  429.                      , ulFlags, lppProblems) \
  430.     (   (   lpPropTagArray \
  431.          && (   IsBadReadPtr( lpPropTagArray, sizeof(ULONG)) \
  432.              || IsBadReadPtr( lpPropTagArray \
  433.                             , (UINT)(  (lpPropTagArray->cValues + 1) \
  434.                                      * sizeof(ULONG))))) \
  435.      || (lpProgress && FBadUnknown( lpProgress )) \
  436.      || (lpInterface && IsBadReadPtr( lpInterface, sizeof(IID))) \
  437.      || IsBadReadPtr( lpDestObj, sizeof(LPVOID)) \
  438.      || (   lppProblems \
  439.          && IsBadWritePtr( lppProblems, sizeof(LPSPropProblemArray))))
  440.  
  441.  
  442.  
  443. /*
  444.  * GetNamesFromIDs
  445.  */
  446. #define FBadGetNamesFromIDs( lpIPDAT, lppPropTags, lpPropSetGuid, ulFlags, \
  447.                              lpcPropNames, lpppPropNames) \
  448.     (   IsBadReadPtr( lppPropTags, sizeof(LPSPropTagArray)) \
  449.      || ( lpPropSetGuid && IsBadReadPtr( lpPropSetGuid, sizeof(GUID))) \
  450.      || (   *lppPropTags \
  451.          && (   IsBadReadPtr( *lppPropTags, sizeof(ULONG)) \
  452.              || IsBadReadPtr( *lppPropTags \
  453.                             , (UINT)(  ((*lppPropTags)->cValues + 1) \
  454.                                      * sizeof(ULONG))))) \
  455.      || IsBadWritePtr( lpcPropNames, sizeof (ULONG)) \
  456.      || IsBadWritePtr( lpppPropNames, sizeof (LPVOID FAR *)))
  457.  
  458.  
  459.  
  460. /*
  461.  * GetNamesFromIDs
  462.  */
  463. #define FBadGetIDsFromNames( lpIPDAT, cPropNames, lppPropNames, ulFlags \
  464.                            , lppPropTags) \
  465.     (   (cPropNames && FBadRglpNameID( lppPropNames, cPropNames)) \
  466.      || IsBadWritePtr( lppPropTags, sizeof(LPULONG FAR *)))
  467.  
  468.  
  469. STDAPI_(ULONG)
  470. FBadRestriction( LPSRestriction lpres );
  471.  
  472. STDAPI_(ULONG)
  473. FBadPropTag( ULONG ulPropTag );
  474.  
  475. STDAPI_(ULONG)
  476. FBadRow( LPSRow lprow );
  477.  
  478. STDAPI_(ULONG)
  479. FBadProp( LPSPropValue lpprop );
  480.  
  481. STDAPI_(ULONG)
  482. FBadSortOrderSet( LPSSortOrderSet lpsos );
  483.  
  484. STDAPI_(ULONG)
  485. FBadColumnSet( LPSPropTagArray lpptaCols );
  486.  
  487. /* Validation function
  488.  
  489.     The eMethod parameter tells us which internal validation to perform.
  490.     
  491.     The ppThis parameter tells us where the stack is, so we can access the other 
  492.     parameters.  
  493.     
  494.     Becuase of this *magic* we MUST obtain the pointer to the This pointer in 
  495.     the method function.
  496.     
  497. */
  498.  
  499. #ifdef WIN16
  500. #define BASED_STACK         __based(__segname("_STACK"))
  501. #else
  502. #define BASED_STACK
  503. #endif
  504.  
  505.  
  506. #ifdef WIN16
  507. HRESULT  PASCAL
  508. #else
  509. HRESULT  STDAPICALLTYPE     
  510. #endif
  511. __CPPValidateParameters(METHODS eMethod, const LPVOID ppFirst);
  512.  
  513. #ifdef WIN16
  514. HRESULT  PASCAL
  515. #else
  516. HRESULT  STDAPICALLTYPE     
  517. #endif
  518. __ValidateParameters(METHODS eMethod, LPVOID ppThis);
  519.  
  520. #ifdef __cplusplus
  521. }
  522. #endif
  523.  
  524. #endif  /* _INC_VALIDATE */
  525.  
  526.