SetAccessListExW

Restricts access to created virtual serial ports for various applications.

BOOL SetAccessListExW(
  	WCHAR *Port, WCHAR * UserSession, void* Buffer, long sizeBuffer
);

Parameters:

  • Port

    A null-terminated string that defines one of the two port names in a pair

  • UserSession
    User session’s ID in which the pair of virtual ports was created.If UserSession is empty, a ports pair was created globally and is visible to all users.

    To know how to get the user session’s ID, refer to GetUserSession.

  • Buffer

    A pointer to PROGRAM_ACCESS array

  • sizeBuffer

    Size of Buffer parameter in bytes

Return values:

Returns TRUE if port access list was created successfully and FALSE otherwise.

Code example:

PROGRAM_ACCESS  pList [3];
pList [0].AccessState = true;
wcscpy (pList [0].Mask, L"z:\\*");
pList [1].AccessState = false;
wcscpy (pList [1].Mask, Lc:\Progra, files\*");
pList [2].AccessState = false;
wcscpy (pList [2].Mask, L"*");
theApp.SetAccessListExW ("COM1", pList, sizeof (PROGRAM_ACCESS) * 3);