/*
- * Copyright (c) 2008-2011 Kernel Drivers, LLC.
- * Copyright (c) 2009-2011 Your File System, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Kernel Drivers, LLC.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013 Your File System, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
- * notice,
- * this list of conditions and the following disclaimer in the
- * documentation
- * and/or other materials provided with the distribution.
- * - Neither the name of Kernel Drivers, LLC nor the names of its
- * contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission from Kernel Drivers, LLC
- * and Your File System, Inc.
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the names of Kernel Drivers, LLC and Your File System, Inc.
+ * nor the names of their contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission from Kernel Drivers, LLC and Your File System, Inc.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
#define IOCTL_AFS_SET_REPARSE_POLICY CTL_CODE( FILE_DEVICE_DISK_FILE_SYSTEM, 0x101C, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#endif /* _AFS_USER_IOCTL_H */
\ No newline at end of file
+#define IOCTL_AFS_GET_REPARSE_POLICY CTL_CODE( FILE_DEVICE_DISK_FILE_SYSTEM, 0x101D, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#endif /* _AFS_USER_IOCTL_H */
/*
- * Copyright (c) 2008-2011 Kernel Drivers, LLC.
- * Copyright (c) 2009-2011 Your File System, Inc.
- * All rights reserved.
+* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Kernel Drivers, LLC.
+* Copyright (c) 2009, 2010, 2011, 2012, 2013 Your File System, Inc.
+* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
- * notice,
- * this list of conditions and the following disclaimer in the
- * documentation
- * and/or other materials provided with the distribution.
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
* - Neither the name of Kernel Drivers, LLC nor the names of its
- * contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission from Kernel Drivers, LLC
- * and Your File System, Inc.
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission from
+ * Kernel Drivers, LLC and Your File System, Inc.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
} AFSSetReparsePointPolicyCB;
-#endif /* _AFS_USER_STRUCT_H */
+typedef struct _AFS_GET_REPARSE_POINT_POLICY
+{
+
+ ULONG GlobalPolicy;
+ ULONG ActivePolicy;
+
+} AFSGetReparsePointPolicyCB;
+
+#endif /* _AFS_USER_STRUCT_H */
return STATUS_ACCESS_DENIED;
}
- return STATUS_SUCCESS;
+ return STATUS_SUCCESS;
case IOCTL_AFS_SET_REPARSE_POLICY:
+ case IOCTL_AFS_GET_REPARSE_POLICY:
//
// Anyone can call this
break;
}
- default:
- {
+ case IOCTL_AFS_GET_REPARSE_POLICY:
+ {
+
+ AFSGetReparsePointPolicyCB *pPolicy = (AFSGetReparsePointPolicyCB *)Irp->AssociatedIrp.SystemBuffer;
+
+ if( pPolicy == NULL ||
+ pIrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof( AFSGetReparsePointPolicyCB))
+ {
+ ntStatus = STATUS_INVALID_PARAMETER;
+ break;
+ }
+
+ ntStatus = AFSGetReparsePointPolicy( pPolicy);
+
+ if ( NT_SUCCESS( ntStatus))
+ {
+
+ Irp->IoStatus.Information = sizeof( AFSGetReparsePointPolicyCB);
+ }
+
+ break;
+ }
+
+ default:
+ {
//
// Check the state of the library
return ntStatus;
}
+
+NTSTATUS
+AFSGetReparsePointPolicy( OUT AFSGetReparsePointPolicyCB *PolicyCB)
+{
+
+ NTSTATUS ntStatus = STATUS_SUCCESS;
+ AFSDeviceExt* pDeviceExt = (AFSDeviceExt *)AFSRDRDeviceObject->DeviceExtension;
+
+ __Enter
+ {
+
+ PolicyCB->GlobalPolicy = pDeviceExt->Specific.RDR.ReparsePointPolicy;
+
+ //
+ // When per-AuthGroup or per-Process policies are permitted
+ // this function will need to query the policies when determining
+ // the active policy.
+ //
+
+ {
+
+ PolicyCB->ActivePolicy = PolicyCB->GlobalPolicy;
+ }
+ }
+
+ return ntStatus;
+}
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Kernel Drivers, LLC.
- * Copyright (c) 2009, 2010, 2011 Your File System, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Kernel Drivers, LLC.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013 Your File System, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
- * notice,
- * this list of conditions and the following disclaimer in the
- * documentation
- * and/or other materials provided with the distribution.
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
* - Neither the names of Kernel Drivers, LLC and Your File System, Inc.
* nor the names of their contributors may be used to endorse or promote
* products derived from this software without specific prior written
NTSTATUS
AFSSetReparsePointPolicy( IN AFSSetReparsePointPolicyCB *Policy);
+NTSTATUS
+AFSGetReparsePointPolicy( OUT AFSGetReparsePointPolicyCB *Policy);
+
//
// Prototypes in AFSFastIoSupprt.cpp
//