I'mr trying to get the inherited rights mask for a folder using
NWIntScanDirectoryInformation2 on NW OES using client 4.91 SP2 from VBA. I
get an undocumented error code -30273 when using the following code. Not
sure if I have the calling syntax correct for VBA.

Any ideas?

Simon Kravis

Public Function CopyNWRightsMask(ByVal sSrc As String, ByVal sDest As
String) As Long

Dim retcode As Long, iterHandle As Long
Dim dirHandle As Byte
Dim Rights As Byte
Dim RightsSrc As Integer
Dim FileName As String, dirname As String
Dim ByteName(256) As Byte
Dim i As Long, Index As Long
Dim fileInfo As NWET_INFO
Dim sDirName As String
Dim iSeq(9) As Byte
Dim DateTime As Long
Dim OwnerID As Long
Dim FilePath As String
Dim result As String

For i = 0 To 3
iSeq(i) = &HFF
Next i

sDirName = String(255, 0) ' fill dir name with nulls


' The netware file path has to be converted to a byte array in order to
' call NWAllocTemporaryDirectoryHandle

FilePath = UCase(KAZNWGetDirName(sSrc))
Call StringToByteArray(ByteName, FilePath & Chr(0))

'' 3. Now we have in byteName variable full dir path and we can ask
'' for temporary directory handle

retcode = NWAllocTemporaryDirectoryHandle(gNWConnHandle, 0,
VarPtr(ByteName(0)), dirHandle, Rights)
If retcode <> 0 Then
Call LogErrorFilFol("", sSrc, "NWAllocTemporaryDirectoryHandle
returned " & NWErrors(retcode))
CopyNWRightsMask = 1
Exit Function
End If

retcode = NWIntScanDirectoryInformation2(gNWConnHandle, dirHandle,
FilePath, VarPtr(iSeq(0)), sDirName, DateTime, OwnerID, RightsSrc, 0)
If retcode <> 0 Then
Call LogErrorFilFol("", dirname, "NWScanDirectoryInformation2
returned " & NWErrors(retcode))
CopyNWRightsMask = 1
Exit Function
End If