Lines Matching refs:handle
26 * Very basic and primitive handle management. Should be sufficient for our needs.
50 /* Never return handle 0 */
73 SHFLHANDLE handle;
79 /* Find next free handle */
86 for(handle=lastHandleIndex;handle<SHFLHANDLE_MAX;handle++)
88 if(pHandles[handle].pvUserData == 0)
90 lastHandleIndex = handle;
95 if(handle == SHFLHANDLE_MAX)
98 for(handle=1;handle<SHFLHANDLE_MAX;handle++)
100 if(pHandles[handle].pvUserData == 0)
102 lastHandleIndex = handle;
106 if(handle == SHFLHANDLE_MAX)
113 pHandles[handle].uFlags = (uType & SHFL_HF_TYPE_MASK) | SHFL_HF_VALID;
114 pHandles[handle].pvUserData = pvUserData;
115 pHandles[handle].pClient = pClient;
121 return handle;
124 static int vbsfFreeHandle(PSHFLCLIENTDATA pClient, SHFLHANDLE handle)
126 if ( handle < SHFLHANDLE_MAX
127 && (pHandles[handle].uFlags & SHFL_HF_VALID)
128 && pHandles[handle].pClient == pClient)
130 pHandles[handle].uFlags = 0;
131 pHandles[handle].pvUserData = 0;
132 pHandles[handle].pClient = 0;
138 uintptr_t vbsfQueryHandle(PSHFLCLIENTDATA pClient, SHFLHANDLE handle,
141 if ( handle < SHFLHANDLE_MAX
142 && (pHandles[handle].uFlags & SHFL_HF_VALID)
143 && pHandles[handle].pClient == pClient)
147 if (pHandles[handle].uFlags & uType)
148 return pHandles[handle].pvUserData;
153 SHFLFILEHANDLE *vbsfQueryFileHandle(PSHFLCLIENTDATA pClient, SHFLHANDLE handle)
155 return (SHFLFILEHANDLE *)vbsfQueryHandle(pClient, handle,
159 SHFLFILEHANDLE *vbsfQueryDirHandle(PSHFLCLIENTDATA pClient, SHFLHANDLE handle)
161 return (SHFLFILEHANDLE *)vbsfQueryHandle(pClient, handle,
165 uint32_t vbsfQueryHandleType(PSHFLCLIENTDATA pClient, SHFLHANDLE handle)
167 if ( handle < SHFLHANDLE_MAX
168 && (pHandles[handle].uFlags & SHFL_HF_VALID)
169 && pHandles[handle].pClient == pClient)
170 return pHandles[handle].uFlags & SHFL_HF_TYPE_MASK;