Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3453126
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:20:19+00:00 2026-05-18T09:20:19+00:00

The declaration is typedef struct _SFILE_FIND_DATA { char cFileName[MAX_PATH]; // Full name of the

  • 0

The declaration is

typedef struct _SFILE_FIND_DATA
{
    char   cFileName[MAX_PATH];         // Full name of the found file
    char * szPlainName;                 // Plain name of the found file
    DWORD  dwHashIndex;                 // Hash table index for the file
    DWORD  dwBlockIndex;                // Block table index for the file
    DWORD  dwFileSize;                  // File size in bytes
    DWORD  dwFileFlags;                 // MPQ file flags
    DWORD  dwCompSize;                  // Compressed file size
    DWORD  dwFileTimeLo;                // Low 32-bits of the file time (0 if not present)
    DWORD  dwFileTimeHi;                // High 32-bits of the file time (0 if not present)
    DWORD  lcLocale;                    // Locale version

} SFILE_FIND_DATA, *PSFILE_FIND_DATA;

HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DATA * lpFindFileData, const char * szListFile)</pre>

I tried

public unsafe struct SFILE_FIND_DATA
{
    fixed byte cFileName[260];         // Full name of the found file
    byte[] szPlainName;                 // Plain name of the found file
    uint dwHashIndex;                 // Hash table index for the file
    uint dwBlockIndex;                // Block table index for the file
    uint dwFileSize;                  // File size in bytes
    uint dwFileFlags;                 // MPQ file flags
    uint dwCompSize;                  // Compressed file size
    uint dwFileTimeLo;                // Low 32-bits of the file time (0 if not present)
    uint dwFileTimeHi;                // High 32-bits of the file time (0 if not present)
    uint lcLocale;                    // Locale version

}

[DllImport("StormLib.dll")]
public static extern uint SFileFindFirstFile(IntPtr hMpq, [MarshalAs(UnmanagedType.LPStr)] string mask,
    out SFILE_FIND_DATA filedata, [MarshalAs(UnmanagedType.LPStr)] string listfile);

Is this right? It doesn’t error but it doesn’t return what it should.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:20:19+00:00Added an answer on May 18, 2026 at 9:20 am

    szPlainName shouldn’t be byte[] – how does the runtime know how big the array is? Try this:

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    public unsafe struct SFILE_FIND_DATA
    {
        fixed byte cFileName[260];         // Full name of the found file
        string szPlainName;                 // Plain name of the found file
        uint dwHashIndex;                 // Hash table index for the file
        uint dwBlockIndex;                // Block table index for the file
        uint dwFileSize;                  // File size in bytes
        uint dwFileFlags;                 // MPQ file flags
        uint dwCompSize;                  // Compressed file size
        uint dwFileTimeLo;                // Low 32-bits of the file time (0 if not present)
        uint dwFileTimeHi;                // High 32-bits of the file time (0 if not present)
        uint lcLocale;                    // Locale version
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble with some struct typedef declarations in a header file not
I have the following struct declaration and typedef in my code: struct blockHeaderStruct {
I have the next definition in a file: File: one.h typedef struct example example;
Whether following structure declaration is right. typedef struct { int roll; int age ;
I have structure declaration in a header globalStruct.h #ifndef _GLOBALSTRUCT_H #define _GLOBALSTRUCT_H typedef struct
Declaration;) MKMapView mapView; I can't found the difference between mapView.userLocation.location.coordinate and mapView.userLocation.coordinate. Is there
declaration of textfield1 <td nowrap=nowrap><input type=text name=textfield1 id=textfield1/></td> trying to return the value entered
SDL provides me this struct: typedef struct SDL_Rect { Sint16 x, y; Uint16 w,
Both this style: struct _something { ... }; typedef struct _something someting; and that
I have something like: typedef struct Data DATA, *DATA_PTR; typedef struct Units UNITS, *UNITS_PTR;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.