dscp = cm_RootSCachep(userp, &req);
- /* Allocate the memory for the response */
- switch (Level) {
- case 2:
- InfoStruct->ShareInfo2 = MIDL_user_allocate(sizeof(SHARE_INFO_2));
- break;
- case 1:
- InfoStruct->ShareInfo1 = MIDL_user_allocate(sizeof(SHARE_INFO_1));
- break;
- case 0:
- InfoStruct->ShareInfo0 = MIDL_user_allocate(sizeof(SHARE_INFO_0));
- break;
- }
-
- if (InfoStruct->ShareInfo0 == NULL) {
- return ERROR_NOT_ENOUGH_MEMORY;
- }
+ InfoStruct->ShareInfo0 = NULL;
/*
* NetName will be:
}
if (scp) {
+ /* Allocate the memory for the response */
+ switch (Level) {
+ case 2:
+ InfoStruct->ShareInfo2 = MIDL_user_allocate(sizeof(SHARE_INFO_2));
+ break;
+ case 1:
+ InfoStruct->ShareInfo1 = MIDL_user_allocate(sizeof(SHARE_INFO_1));
+ break;
+ case 0:
+ InfoStruct->ShareInfo0 = MIDL_user_allocate(sizeof(SHARE_INFO_0));
+ break;
+ case 501:
+ case 502:
+ case 503:
+ case 1004:
+ case 1005:
+ case 1006:
+ default:
+ cm_ReleaseSCache(scp);
+ return HRESULT_FROM_WIN32(ERROR_INVALID_LEVEL);
+ }
+
+ if (InfoStruct->ShareInfo0 == NULL) {
+ cm_ReleaseSCache(scp);
+ return HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY);
+ }
+
switch (Level) {
case 2:
/* for share level security */