RAPI CeFindAllFiles


S. J. Brooks

There was a post quite a while back on this topic, however it didn't look
like it was resolved. I am having an issue with the CeFindAllFiles function.
I can get it to return the number of files in a directory and the file
attributes, however I cannot get it to return the name of the file. Here is
the code:

public int FindAllFiles(string dir)


int a = 0;


CE_FIND_DATA[] arrFound = new CE_FIND_DATA[1];

CeFindAllFiles(dir,FAF_NAME, ref a, ref arrFound[0]);

return a;


public struct CE_FIND_DATA


public uint dwFileAttributes;

public int ftCreationTime;

public int ftCreationTime2;

public int ftLastAccessTime;

public int ftLastAccessTime2;

public int ftLastWriteTime;

public int ftLastWriteTime2;

public int nFileSizeHigh;

public int nFileSizeLow;

public int dwOID;

[MarshalAs(UnmanagedType.ByValTStr, SizeConst=260)] public string cFileName;


I have also tried declaring cFileName as

[MarshalAs(UnmanagedType.ByValArray, SizeConst=260)] public byte[]

which only returns all zero's. Any help would be appreciated.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question