Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-8502

UInt32x32To64 from autogenerated winnt.h breaks RPC

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 0.3.17
    • CRT
    • 64,016

    Description

      Starting with r64016, RPC in second stage seems to fail:
      https://build.reactos.org/builders/Linux_AMD64_1%20KVM-Test/builds/6998/steps/test/logs/stdio

      According to a diff of the disassembly for ntdll, the code differences are caused by different definitions of Int32x32To64 and Int64ShrlMod32.

      Examples of functions with binary differences are CsrCaptureTimeout and LdrpInitSecurityCookie, respectively.

      The following change seems to make the differences go away:

      --- include/psdk/winnt.h	(revision 64017)
      +++ include/psdk/winnt.h	(working copy)
      @@ -741,3 +741,3 @@
          asm functions, the compiler can optimize this better. */
      -#define Int32x32To64(a,b) (((__int64)(long)(a))*((__int64)(long)(b)))
      +#define Int32x32To64(a,b) (((__int64)(a))*((__int64)(b)))
       #define UInt32x32To64(a,b) ((unsigned __int64)(unsigned int)(a)*(unsigned __int64)(unsigned int)(b)) 
      @@ -753,3 +753,3 @@
        #define Int64ShraMod32(a,b) __ll_rshift(a,b)
      - #define Int64ShrlMod32(a,b) __ull_rshift(a,b)
      + #define Int64ShrlMod32(a,b) (((unsigned __int64)(a))>>(b))
       #endif

      Attachments

        1. kernel32-pipe-fix-math.patch
          1 kB
          ThFabba
        2. kernel32-unsigned-mult.patch
          3 kB
          ThFabba
        3. winnt-int-allmath.patch
          0.9 kB
          ThFabba
        4. winnt-int-both.patch
          0.9 kB
          ThFabba

        Issue Links

          Activity

            People

              ThePhysicist Timo Kreuzer
              ThFabba ThFabba
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: