@@ -104,7 +104,7 @@ UINT _txm_module_manager_object_memory_check(TXM_MODULE_INSTANCE *module_instan
104104/* FUNCTION RELEASE */
105105/* */
106106/* _txm_module_manager_created_object_check PORTABLE C */
107- /* 6.1 */
107+ /* 6.1x */
108108/* AUTHOR */
109109/* */
110110/* Scott Larson, Microsoft Corporation */
@@ -137,22 +137,20 @@ UINT _txm_module_manager_object_memory_check(TXM_MODULE_INSTANCE *module_instan
137137/* DATE NAME DESCRIPTION */
138138/* */
139139/* 09-30-2020 Scott Larson Initial Version 6.1 */
140+ /* xx-xx-2025 William E. Lamie Modified comment(s), and */
141+ /* removed module local memory */
142+ /* check, resulting in */
143+ /* version 6.1x */
140144/* */
141145/**************************************************************************/
142146UCHAR _txm_module_manager_created_object_check (TXM_MODULE_INSTANCE * module_instance , VOID * object_ptr )
143147{
144148
145149TXM_MODULE_ALLOCATED_OBJECT * allocated_object_ptr ;
146150
147- /* Determine if the socket control block is inside the module. */
148- if ( (((CHAR * ) object_ptr ) >= ((CHAR * ) module_instance -> txm_module_instance_data_start )) &&
149- (((CHAR * ) object_ptr ) < ((CHAR * ) module_instance -> txm_module_instance_data_end )))
150- {
151- return TX_TRUE ;
152- }
153151
154- /* Determine if this object control block was allocated by this module instance . */
155- else if (_txm_module_manager_object_pool_created )
152+ /* Determine if the object pool has been created . */
153+ if (_txm_module_manager_object_pool_created )
156154 {
157155
158156 /* Determine if the current object is from the pool of dynamically allocated objects. */
@@ -336,6 +334,158 @@ CHAR object_name_char;
336334}
337335
338336
337+ /**************************************************************************/
338+ /* */
339+ /* FUNCTION RELEASE */
340+ /* */
341+ /* _txm_module_manager_param_check_object_for_creation PORTABLE C */
342+ /* 6.4.3 */
343+ /* AUTHOR */
344+ /* */
345+ /* William E. Lamie, RTOSX */
346+ /* */
347+ /* DESCRIPTION */
348+ /* */
349+ /* This function checks to make sure the object pointer for one of the */
350+ /* creation APIs is valid. */
351+ /* */
352+ /* INPUT */
353+ /* */
354+ /* module_instance Requesting module instance pointer*/
355+ /* object_ptr Address of object memory area */
356+ /* ojbect_size Size of object memory area */
357+ /* */
358+ /* OUTPUT */
359+ /* */
360+ /* TX_TRUE Valid object pointer */
361+ /* TX_FALSE Invalid object pointer */
362+ /* */
363+ /* CALLS */
364+ /* */
365+ /* None */
366+ /* */
367+ /* CALLED BY */
368+ /* */
369+ /* txm_module_manager_* Module manager functions */
370+ /* */
371+ /* RELEASE HISTORY */
372+ /* */
373+ /* DATE NAME DESCRIPTION */
374+ /* */
375+ /* xx-xx-2025 William E. Lamie Initial Version 6.4.3 */
376+ /* */
377+ /**************************************************************************/
378+ UINT _txm_module_manager_param_check_object_for_creation (TXM_MODULE_INSTANCE * module_instance , ALIGN_TYPE object_ptr , ULONG object_size )
379+ {
380+
381+ /* Determine if the object pointer is NULL. */
382+ if ((void * ) object_ptr == TX_NULL )
383+ {
384+
385+ /* Object pointer is NULL, which is invalid. */
386+ return (TX_FALSE );
387+ }
388+
389+ /* Determine if the object pointer is inside the module object pool. */
390+ if (TXM_MODULE_MANAGER_ENSURE_INSIDE_OBJ_POOL (module_instance , object_ptr , object_size ) == TX_FALSE )
391+ {
392+
393+ /* Object pointer is not inside the object pool, which is invalid. */
394+ return (TX_FALSE );
395+ }
396+
397+ /* Determine if the object size is correct. */
398+ if (_txm_module_manager_object_size_check (object_ptr , object_size ) != TX_SUCCESS )
399+ {
400+
401+ /* Object size is invalid. */
402+ return (TX_FALSE );
403+ }
404+
405+ /* Determine if the ojbect has already been created. */
406+ if (_txm_module_manager_created_object_check (module_instance , (void * ) object_ptr ) == TX_FALSE )
407+ {
408+
409+ /* Object has already been created, which is invalid. */
410+ return (TX_FALSE );
411+ }
412+
413+ /* Everything is okay with the object, return TX_TRUE. */
414+ return (TX_TRUE );
415+ }
416+
417+
418+ /**************************************************************************/
419+ /* */
420+ /* FUNCTION RELEASE */
421+ /* */
422+ /* _txm_module_manager_param_check_object_for_use PORTABLE C */
423+ /* 6.4.3 */
424+ /* AUTHOR */
425+ /* */
426+ /* William E. Lamie, RTOSX */
427+ /* */
428+ /* DESCRIPTION */
429+ /* */
430+ /* This function checks to make sure the object pointer is valid. */
431+ /* */
432+ /* INPUT */
433+ /* */
434+ /* module_instance Requesting module instance pointer*/
435+ /* object_ptr Address of object memory area */
436+ /* ojbect_size Size of object memory area */
437+ /* */
438+ /* OUTPUT */
439+ /* */
440+ /* TX_TRUE Valid object pointer */
441+ /* TX_FALSE Invalid object pointer */
442+ /* */
443+ /* CALLS */
444+ /* */
445+ /* None */
446+ /* */
447+ /* CALLED BY */
448+ /* */
449+ /* txm_module_manager_* Module manager functions */
450+ /* */
451+ /* RELEASE HISTORY */
452+ /* */
453+ /* DATE NAME DESCRIPTION */
454+ /* */
455+ /* xx-xx-2025 William E. Lamie Initial Version 6.4.3 */
456+ /* */
457+ /**************************************************************************/
458+ UINT _txm_module_manager_param_check_object_for_use (TXM_MODULE_INSTANCE * module_instance , ALIGN_TYPE object_ptr , ULONG object_size )
459+ {
460+
461+ /* Determine if the object pointer is NULL. */
462+ if ((void * ) object_ptr == TX_NULL )
463+ {
464+
465+ /* Object pointer is NULL, which is invalid. */
466+ return (TX_FALSE );
467+ }
468+
469+ /* Determine if the object pointer is inside the module object pool. */
470+ if (TXM_MODULE_MANAGER_ENSURE_OUTSIDE_MODULE (module_instance , object_ptr , object_size ) == TX_FALSE )
471+ {
472+
473+ /* Object pointer is not inside the object pool, which is invalid. */
474+ return (TX_FALSE );
475+ }
476+
477+ /* Define application-specific object memory check. */
478+ #ifdef TXM_MODULE_MANGER_APPLICATION_VALID_OBJECT_MEMORY_CHECK
479+
480+ /* Bring in the application-spefic objeft memory check, defined by the user. */
481+ TXM_MODULE_MANGER_APPLICATION_VALID_OBJECT_MEMORY_CHECK
482+ #endif /* TXM_MODULE_MANGER_APPLICATION_VALID_OBJECT_MEMORY_ENABLE */
483+
484+ /* Everything is okay with the object, return TX_TRUE. */
485+ return (TX_TRUE );
486+ }
487+
488+
339489/**************************************************************************/
340490/* */
341491/* FUNCTION RELEASE */
@@ -414,3 +564,5 @@ ULONG data_alignment_ignored;
414564 /* Return success. */
415565 return (TX_SUCCESS );
416566}
567+
568+
0 commit comments