Author Topic: a game with line prototype and conditions  (Read 1442 times)

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
a game with line prototype and conditions
« on: September 29, 2014, 02:40:14 AM »

I am trying to put the following lines in order to be translated for masm.

Quote
int
#if !defined(_MAC)
#if defined(_M_CEE_PURE)
__clrcall
#else
WINAPI
#endif
#else
CALLBACK
#endif
WinMain (
    _In_ HINSTANCE hInstance,
    _In_opt_ HINSTANCE hPrevInstance,
    _In_ LPSTR lpCmdLine,
    _In_ int nShowCmd
    );


one not to much difficult exercice
Quote
KSECDDDECLSPEC
SECURITY_STATUS SEC_ENTRY
QuerySecurityPackageInfoW(
#if ISSP_MODE == 0
                PSECURITY_STRING pPackageName,
#else
                LPWSTR pszPackageName,          // Name of package
#endif
    _Outptr_ PSecPkgInfoW *ppPackageInfo     // Receives package info
    );

Modify form

Quote
#if ISSP_MODE == 0
KSECDDDECLSPEC
SECURITY_STATUS SEC_ENTRY
QuerySecurityPackageInfoW(
   PSECURITY_STRING pPackageName,
    _Outptr_ PSecPkgInfoW *ppPackageInfo     // Receives package info
    );
#else
KSECDDDECLSPEC
SECURITY_STATUS SEC_ENTRY
QuerySecurityPackageInfoW(
                LPWSTR pszPackageName,          // Name of package
    _Outptr_ PSecPkgInfoW *ppPackageInfo     // Receives package info
    );
#endif


Any idea ?
Fa is a musical note to play with CL

dedndave

  • Member
  • *****
  • Posts: 8734
  • Still using Abacus 2.0
    • DednDave
Re: a game with line prototype and conditions
« Reply #1 on: September 29, 2014, 03:31:58 AM »
Code: [Select]
    #if defined(_MAC)
        int CALLBACK WinMain (
                       _In_ HINSTANCE hInstance,
                       _In_opt_ HINSTANCE hPrevInstance,
                       _In_ LPSTR lpCmdLine,
                       _In_ int nShowCmd
                        );
    #else
        #if defined(_M_CEE_PURE)
            int __clrcall WinMain (
                            _In_ HINSTANCE hInstance,
                            _In_opt_ HINSTANCE hPrevInstance,
                            _In_ LPSTR lpCmdLine,
                            _In_ int nShowCmd
                             );
        #else
            int WINAPI WinMain (
                         _In_ HINSTANCE hInstance,
                         _In_opt_ HINSTANCE hPrevInstance,
                         _In_ LPSTR lpCmdLine,
                         _In_ int nShowCmd
                          );
        #endif
    #endif

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: a game with line prototype and conditions
« Reply #2 on: September 29, 2014, 04:47:13 AM »

Very near,after a long search
Quote
#if !defined(_MAC)

   #if defined(_M_CEE_PURE)
      int   
      __clrcall
   WinMain (
            HINSTANCE hInstance,
                HINSTANCE hPrevInstance,
            LPSTR lpCmdLine,
            int nShowCmd
       );

   #else
   int
      WINAPI
   WinMain (
            HINSTANCE hInstance,
                HINSTANCE hPrevInstance,
            LPSTR lpCmdLine,
            int nShowCmd
       );

   
   #endif
#else
   int
   CALLBACK
WinMain (
         HINSTANCE hInstance,
             HINSTANCE hPrevInstance,
         LPSTR lpCmdLine,
         int nShowCmd
    );

#endif
Fa is a musical note to play with CL

dedndave

  • Member
  • *****
  • Posts: 8734
  • Still using Abacus 2.0
    • DednDave
Re: a game with line prototype and conditions
« Reply #3 on: September 29, 2014, 05:08:38 AM »
Code: [Select]
    #if defined(_MAC)
        #define BlahBlahBlah CALLBACK
    #else
        #if defined(_M_CEE_PURE)
            #define BlahBlahBlah __clrcall
        #else
            #define BlahBlahBlah WINAPI
        #endif
    #endif
    int BlahBlahBlah WinMain (
                       _In_ HINSTANCE hInstance,
                       _In_opt_ HINSTANCE hPrevInstance,
                       _In_ LPSTR lpCmdLine,
                       _In_ int nShowCmd
                        );

easier to read and understand - and BlahBlahBlah may be used later to reduce text   :P

dedndave

  • Member
  • *****
  • Posts: 8734
  • Still using Abacus 2.0
    • DednDave
Re: a game with line prototype and conditions
« Reply #4 on: October 11, 2014, 07:57:18 PM »
Taro - in the upper right corner of the forum page is a link to MASM32 Downloads
download and install the masm32 package
once installed, there are folders for help and examples