D.d. Tue, 17 Sep 2002 21:28:16 GMT, "Throtston"
<not_theronscott@not_earthlink.net> schreef het volgende:
Hi,
>I am having difficulties using NXDirEnumGetEntries on legacy volume,
>but no
>problem on an NSS volume. I am almost sure that it was working
>before, but
>I could be wrong.
>
>The final "rc" returns 0x51 for Legacy and 0x00 for NSS volumes.
The
>full
>code is attached.
>
>Any suggestions? Using LibC dated 06-24-02, size 1,262,679.
This pice of reply is from a 2002 question in NKS forum.
I'm currently seeing the same behavior for NSS volumes.
That is, NXDirEnumGetEntries return a 51 code (by the looks of it,
buffer to small).
Code:
#include <stdio.h>
#include <screen.h>
#include <string.h>
#include <dirio.h>
union
{
NXDirAttr_t deDirAttr;
NXDirMark_t deDirMark;
void *deName;
} buffer;
NXHandle_t desHand;
size_t entriesReturned;
NXDirMark_t next;
NXPathCtx_t pCtx;
int rc;
NXBool_t sequenceGuarantee;
/****************************** Begin Code
***********************************/
int main
(
int argc,
char *argv[],
char *env[]
)
{
#pragma unused (argc)
#pragma unused (env)
if (argv[1] == NULL)
{
printf("FileIO rootpath\n");
goto Exit;
}
printf("Root path (%s)\n", argv[1]);
rc = NXCreatePathContext(0, argv[1], NX_PNF_NKS, 0, &pCtx);
printf("NXCreatePathContext rc(%x)\n", rc);
if (rc) goto Exit;
rc = NXDirEnumStart(pCtx, ".", NX_DELEVEL_BASIC, &desHand);
printf("NXDirEnumStart(pCtx rc(%x)\n", rc);
if (rc) goto ExitPCtx;
rc = NXDirMarkInit(desHand /*pCtx*/, &next);
printf("NXDirMarkInit rc(%x)/n", rc);
printf("rc = %x\n", rc);
if (rc) goto ExitPCtx;
rc = NXDirEnumGetEntries(desHand, &next, &buffer, sizeof(buffer),
&entriesReturned, &next,
&sequenceGuarantee);
printf("NXDirEnumGetEntries rc(%x)\n", rc);
if (rc) goto ExitPCtx;
printf("entriesReturned (%x)\n", entriesReturned);
ExitDesHand:
rc = NXDirEnumEnd(desHand);
printf("NXDirEnumEnd rc(%x)\n", rc);
ExitPCtx:
rc = NXFreePathContext(pCtx);
printf("NXFreePathContext rc(%x)\n", rc);
Exit:
printf("Exit\n");
pressanykey();
return 0;
}
LIBC.NLM
Loaded from [C:\NWSERVER\] on Jul 16, 2007 9:05:02 pm
(Address Space = ADMINSRV)
Standard C Runtime Library for NLMs [optimized, 7]
Version 9.00.05 February 28, 2007
|