<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic One would think LARGE_INTEGER in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974315#M97907</link>
    <description>One would think LARGE_INTEGER should be compatible with integer(C_INT64_T) and PLARGE_INTEGER with integer(C_INTPTR_T), should IFWINTY not offer suitable definitions.  Are you hinting that you have to turn off gen-interfaces?  That would indicate there are definitions in a .mod which conflict with yours.
The doc suggests you look in to the source of IFWIN.  I'm wondering if the sources are still supplied, as they were at the time the doc was written.
It might be useful to have a complete reproducer.</description>
    <pubDate>Mon, 17 Dec 2012 12:46:41 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2012-12-17T12:46:41Z</dc:date>
    <item>
      <title>LARGE_INTEGER in Windows API Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974313#M97905</link>
      <description>&lt;P&gt;My program calls a number of Windows API functions, with USE IFWIN declared. However, I'm unable to get SetFilePointerEx to work. According to Windows documentation, one of the parameters is type LARGE_INTEGER and another PLARGE_INTEGER. I've tried declaring the LARGE_INTEGER parameter (liDistanceToMove) in each of the following ways (one at a time):&lt;/P&gt;
&lt;P&gt;INTEGER (LARGE_INTEGER) :: liDistanceToMove&lt;/P&gt;
&lt;P&gt;----------&lt;/P&gt;
&lt;P&gt;TYPE (LARGE_INTEGER) :: liDistanceToMove&lt;/P&gt;
&lt;P&gt;----------&lt;/P&gt;
&lt;P&gt;INTEGER (KIND = 8) :: liDistanceToMove&lt;/P&gt;
&lt;P&gt;-----------&lt;/P&gt;
&lt;P&gt;TYPE LARGE_INTEGER&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; SEQUENCE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; INTEGER (DWORD) :: LowPart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; INTEGER (DWORD) :: HighPart&lt;/P&gt;
&lt;P&gt;END TYPE&lt;/P&gt;
&lt;P&gt;TYPE (LARGE_INTEGER) :: liDistanceToMove&lt;/P&gt;
&lt;P&gt;------------&lt;/P&gt;
&lt;P&gt;None of these work. The most common error is #6633, that the type of the actual argment differs from the dummy argument.&lt;/P&gt;
&lt;P&gt;How do I declare this parameter (and the PLARGE_INTEGER type)?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2012 08:13:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974313#M97905</guid>
      <dc:creator>groupw_bench</dc:creator>
      <dc:date>2012-12-17T08:13:04Z</dc:date>
    </item>
    <item>
      <title>According to MSDN "Windows NT</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974314#M97906</link>
      <description>According to MSDN "Windows NT defines a LARGE_INTEGER data type that is a 64-bit integer created from an array of two longwords. A LARGE_INTEGER type is not the same as a quadword. The quadword is a true, nonportable, 64-bit integer data type; the Windows NT LARGE_INTEGER is a data type that is 8 bytes in size and is usable as a 64-bit integer only in conjunction with a set of run-time library functions. You should not redefine the LARGE_INTEGER type."

Note the last sentence.

Also see here for LARGE_INTEGER structure.
&lt;A href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa383713%28v=vs.85%29.aspx" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/aa383713%28v=vs.85%29.aspx&lt;/A&gt;</description>
      <pubDate>Mon, 17 Dec 2012 11:10:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974314#M97906</guid>
      <dc:creator>Anthony_Richards</dc:creator>
      <dc:date>2012-12-17T11:10:00Z</dc:date>
    </item>
    <item>
      <title>One would think LARGE_INTEGER</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974315#M97907</link>
      <description>One would think LARGE_INTEGER should be compatible with integer(C_INT64_T) and PLARGE_INTEGER with integer(C_INTPTR_T), should IFWINTY not offer suitable definitions.  Are you hinting that you have to turn off gen-interfaces?  That would indicate there are definitions in a .mod which conflict with yours.
The doc suggests you look in to the source of IFWIN.  I'm wondering if the sources are still supplied, as they were at the time the doc was written.
It might be useful to have a complete reproducer.</description>
      <pubDate>Mon, 17 Dec 2012 12:46:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974315#M97907</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2012-12-17T12:46:41Z</dc:date>
    </item>
    <item>
      <title>By historical convention, MS</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974316#M97908</link>
      <description>Try adding USE IFWINTY

By historical convention, MS C/C++ chose to make LARGE_INTEGER a struct and not a __int64 (int64_t, ...). This struct does contain a QuadPart member unioned with the {DWORD LowPart, DWORD HighPart}. In IVF this convention is followed by making LARGE_INTEGER (e.g. T_LARGE_INTEGERX) a type that on x64 platform has "integer(8) value" and on x32 platform has a sequenced "integer(4) LowPart; integer(4) HighPart".  This declaration is in IFWINTY

As TimP mentioned: Do not redefine a type defined by a provided module (i.e. USE the module containing the definition)

Jim Dempsey</description>
      <pubDate>Mon, 17 Dec 2012 15:42:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974316#M97908</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2012-12-17T15:42:00Z</dc:date>
    </item>
    <item>
      <title>Here's how I control the file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974317#M97909</link>
      <description>Here's how I control the file pointer, with the regular version of the API function and absolute position within the file:

[fortran]
RECURSIVE SUBROUTINE Set_File_Pointer (ihandl, offset, truncate)
	IMPLICIT NONE
	INTEGER(HANDLE), INTENT(IN)     :: ihandl
	INTEGER, INTENT(IN)				:: offset
	LOGICAL, INTENT(IN), OPTIONAL	:: truncate
	INTEGER							:: rslt
	rslt = SetFilePointer (ihandl, MAX0(offset,0), NULL, FILE_BEGIN)
	
	IF (PRESENT(truncate)) rslt = SetEndOfFile (ihandl)				
END SUBROUTINE Set_File_Pointer
[/fortran]</description>
      <pubDate>Mon, 17 Dec 2012 16:07:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974317#M97909</guid>
      <dc:creator>Paul_Curtis</dc:creator>
      <dc:date>2012-12-17T16:07:56Z</dc:date>
    </item>
    <item>
      <title>The thing you are forgetting</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974318#M97910</link>
      <description>The thing you are forgetting is that ifort prepends "T_" to Windows user-defined types. Thus you need T_LARGE_INTEGER to make this work.</description>
      <pubDate>Mon, 17 Dec 2012 17:51:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974318#M97910</guid>
      <dc:creator>JVanB</dc:creator>
      <dc:date>2012-12-17T17:51:43Z</dc:date>
    </item>
    <item>
      <title>BTW you can look this up in</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974319#M97911</link>
      <description>BTW you can look this up in ifwinty.f90 and use TRANSFER to convert back and forth between INTEGER(8) and T_LARGE_INTEGER.</description>
      <pubDate>Mon, 17 Dec 2012 17:53:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974319#M97911</guid>
      <dc:creator>JVanB</dc:creator>
      <dc:date>2012-12-17T17:53:00Z</dc:date>
    </item>
    <item>
      <title>Thanks very much, Repeat</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974320#M97912</link>
      <description>Thanks very much, Repeat Offender. Of all the responses, yours were the ones which actually answered my question. The compiler is happy when I declare both variables as TYPE (T_LARGE_INTEGER). I found the definition of this type in IFWINTY.f90. The TRANSFER tip is very helpful, too. Thanks again.</description>
      <pubDate>Mon, 17 Dec 2012 20:58:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/LARGE-INTEGER-in-Windows-API-Function/m-p/974320#M97912</guid>
      <dc:creator>groupw_bench</dc:creator>
      <dc:date>2012-12-17T20:58:17Z</dc:date>
    </item>
  </channel>
</rss>

