Observation/Question on use of NTSTATUS in the Samba4 code base

Krishna Ganugapati krishnag at centeris.com
Tue Apr 3 23:18:40 GMT 2007


I happened to notice that Samba4 uses NTSTATUS codes throughout its code
base irrespective of whether the code is "user mode" code or "kernel
mode" code, All NT device drivers use NTSTATUS which means the kernel
mode transports - the netbt.sys, smb.sys,  and the kernel mode file
systems srv,sys (the SMB file server and npfs.sys (the named pipe file
system). However all user mode code typically uses Win32 errror codes
(WERRORS).  I noticed that the samr.idl files use NTSTATUS and so do the
eventlog.idl files. I would have thought that the samr stuff returns
WERRORs.

 

I also notice that the rpc code uses NTSTATUS error codes - I know that
the named pipe support would use Win32 error codes  (in user space) and
therefore the rpc returns would be WERRORs  but it seems that the Samba4
implementation uses NTSTATUS codes.

 

 

Is there any particular formal model that Samba4 subscribes to with
respect to error codes? In general there is not a 1-1 mapping between
WERRORS and NTSTATUS codes

 

Thx

Krishna



More information about the samba-technical mailing list