Ignore:
Timestamp:
Jan 2, 2000, 11:51:58 PM (26 years ago)
Author:
sandervl
Message:

PB: Started with named pipe api implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/stubs.cpp

    r2280 r2301  
    1 /* $Id: stubs.cpp,v 1.17 1999-12-31 10:47:11 sandervl Exp $ */
     1/* $Id: stubs.cpp,v 1.18 2000-01-02 22:51:12 sandervl Exp $ */
    22
    33/*
     
    6060#define STREAM_CONTAINS_SECURITY        0x00000002
    6161#define STREAM_CONTAINS_PROPERTIES      0x00000004
    62 
    63 // Named Pipes
    64 
    65 #define NMPWAIT_WAIT_FOREVER            0xffffffff
    66 #define NMPWAIT_NOWAIT                  0x00000001
    67 #define NMPWAIT_USE_DEFAULT_WAIT        0x00000000
    6862
    6963
     
    413407}
    414408
    415 /*****************************************************************************
    416  * Name      : BOOL WIN32AOI CallNamedPipeA
    417  * Purpose   : The CallNamedPipe function connects to a message-type pipe
    418  *             (and waits if an instance of the pipe is not available),
    419  *             writes to and reads from the pipe, and then closes the pipe.
    420  * Parameters:  LPCSTR lpNamedPipeName pointer to pipe name
    421  *              LPVOID lpInBuffer      pointer to write buffer
    422  *              DWORD nInBufferSize    size, in bytes, of write buffer
    423  *              LPVOID lpOutBuffer     pointer to read buffer
    424  *              DWORD nOutBufferSize   size, in bytes, of read buffer
    425  *              LPDWORD lpBytesRead    pointer to number of bytes read
    426  *              DWORD nTimeOut         time-out time, in milliseconds
    427  * Variables :
    428  * Result    : If the function succeeds, the return value is nonzero.
    429  *             If the function fails, the return value is zero.
    430  *             To get extended error information, call GetLastError.
    431  * Remark    : Calling CallNamedPipe is equivalent to calling the CreateFile
    432  *             (or WaitNamedPipe, if CreateFile cannot open the pipe immediately),
    433  *             TransactNamedPipe, and CloseHandle functions. CreateFile is called
    434  *             with an access flag of GENERIC_READ | GENERIC_WRITE, an inherit
    435  *             handle flag of FALSE, and a share mode of zero (indicating no
    436  *             sharing of this pipe instance).
    437  *             If the message written to the pipe by the server process is
    438  *             longer than nOutBufferSize, CallNamedPipe returns FALSE, and
    439  *             GetLastError returns ERROR_MORE_DATA. The remainder of the
    440  *             message is discarded, because CallNamedPipe closes the handle
    441  *             to the pipe before returning.
    442  *
    443  *             CallNamedPipe fails if the pipe is a byte-type pipe.
    444  * Status    : UNTESTED STUB
    445  *
    446  * Author    : Markus Montkowski [Thu, 1998/05/19 11:46]
    447  *****************************************************************************/
    448 
    449 BOOL WIN32API CallNamedPipeA( LPCSTR lpNamedPipeName,
    450                                   LPVOID lpInBuffer, DWORD nInBufferSize,
    451                                   LPVOID lpOutBuffer, DWORD nOutBufferSize,
    452                                   LPDWORD lpBytesRead, DWORD nTimeOut)
    453 {
    454 
    455   dprintf(("KERNEL32:  CallNamedPipeA(%08x,%08x,%08x,%08x,%08x,%08x) not implemented\n",
    456            lpNamedPipeName, lpInBuffer, nInBufferSize,
    457            lpOutBuffer, nOutBufferSize, lpBytesRead,  nTimeOut
    458           ));
    459 
    460   return (FALSE);
    461 }
    462 
    463 /*****************************************************************************
    464  * Name      : BOOL WIN32AOI CallNamedPipeA
    465  * Purpose   : The CallNamedPipe function connects to a message-type pipe
    466  *             (and waits if an instance of the pipe is not available),
    467  *             writes to and reads from the pipe, and then closes the pipe.
    468  * Parameters:  LPCWSTR lpNamedPipeName pointer to pipe name
    469  *              LPVOID lpInBuffer      pointer to write buffer
    470  *              DWORD nInBufferSize    size, in bytes, of write buffer
    471  *              LPVOID lpOutBuffer     pointer to read buffer
    472  *              DWORD nOutBufferSize   size, in bytes, of read buffer
    473  *              LPDWORD lpBytesRead    pointer to number of bytes read
    474  *              DWORD nTimeOut         time-out time, in milliseconds
    475  * Variables :
    476  * Result    : If the function succeeds, the return value is nonzero.
    477  *             If the function fails, the return value is zero.
    478  *             To get extended error information, call GetLastError.
    479  * Remark    : Calling CallNamedPipe is equivalent to calling the CreateFile
    480  *             (or WaitNamedPipe, if CreateFile cannot open the pipe immediately),
    481  *             TransactNamedPipe, and CloseHandle functions. CreateFile is called
    482  *             with an access flag of GENERIC_READ | GENERIC_WRITE, an inherit
    483  *             handle flag of FALSE, and a share mode of zero (indicating no
    484  *             sharing of this pipe instance).
    485  *             If the message written to the pipe by the server process is
    486  *             longer than nOutBufferSize, CallNamedPipe returns FALSE, and
    487  *             GetLastError returns ERROR_MORE_DATA. The remainder of the
    488  *             message is discarded, because CallNamedPipe closes the handle
    489  *             to the pipe before returning.
    490  *
    491  *             CallNamedPipe fails if the pipe is a byte-type pipe.
    492  * Status    : UNTESTED STUB
    493  *
    494  * Author    : Markus Montkowski [Thu, 1998/05/19 11:46]
    495  *****************************************************************************/
    496 
    497 BOOL WIN32API CallNamedPipeW( LPCWSTR lpNamedPipeName,
    498                                   LPVOID lpInBuffer, DWORD nInBufferSize,
    499                                   LPVOID lpOutBuffer, DWORD nOutBufferSize,
    500                                   LPDWORD lpBytesRead, DWORD nTimeOut)
    501 {
    502 
    503   dprintf(("KERNEL32:  CallNamedPipeA(%08x,%08x,%08x,%08x,%08x,%08x) not implemented\n",
    504            lpNamedPipeName, lpInBuffer, nInBufferSize,
    505            lpOutBuffer, nOutBufferSize, lpBytesRead,  nTimeOut
    506           ));
    507 
    508   return (FALSE);
    509 }
    510409/*****************************************************************************
    511410 * Name      : BOOL WIN32API CancelIo
     
    573472  dprintf(("KERNEL32:CancelWaitableTimer(%08x) not implemented\n",
    574473           hTimer
    575           ));
    576 
    577   return (FALSE);
    578 }
    579 
    580 /*****************************************************************************
    581  * Name      : BOOL WIN32API ConnectNamedPipe
    582  * Purpose   : The ConnectNamedPipe function enables a named pipe server process
    583  *             to wait for a client process to connect to an instance of a
    584  *             named pipe. A client process connects by calling either the
    585  *             CreateFile or CallNamedPipe function.
    586  * Parameters:  HANDLE hNamedPipe      handle to named pipe to connect
    587  *              LPOVERLAPPED lpOverlapped  pointer to overlapped structure
    588  * Variables :
    589  * Result    : If the function succeeds, the return value is nonzero.
    590  *             If the function fails, the return value is zero.
    591  *             To get extended error information, call GetLastError.
    592  * Remark    :
    593  * Status    : UNTESTED STUB
    594  *
    595  * Author    : Markus Montkowski [Thu, 1998/05/19 11:46]
    596  *****************************************************************************/
    597 
    598 BOOL WIN32API ConnectNamedPipe(HANDLE hNamedPipe, LPOVERLAPPED lpOverlapped)
    599 {
    600 
    601   dprintf(("KERNEL32: ConnectNamedPipe(%08x,%08x) not implemented\n",
    602            hNamedPipe, lpOverlapped
    603474          ));
    604475
     
    12461117}
    12471118/*****************************************************************************
    1248  * Name      : BOOL WIN32API DisconnectNamedPipe
    1249  * Purpose   : The DisconnectNamedPipe function disconnects the server end
    1250  *             of a named pipe instance from a client process.
    1251  * Parameters: HANDLE hNamedPipe    handle to named pipe
    1252  * Variables :
    1253  * Result    : If the function succeeds, the return value is nonzero.
    1254  *             If the function fails, the return value is zero
    1255  * Remark    :
    1256  * Status    : UNTESTED STUB
    1257  *
    1258  * Author    : Markus Montkowski [Tha, 1998/05/21 17:46]
    1259  *****************************************************************************/
    1260 
    1261 BOOL WIN32API DisconnectNamedPipe(HANDLE hNamedPipe)
    1262 {
    1263 
    1264   dprintf(("KERNEL32: DisconnectNamedPipe(%08x) not implemented\n",
    1265            hNamedPipe
    1266           ));
    1267 
    1268   return (FALSE);
    1269 }
    1270 
    1271 /*****************************************************************************
    12721119 * Name      : BOOL WIN3API EndUpdateResourceA
    12731120 * Purpose   : The EndUpdateResourceA function ends a resource update
     
    18691716
    18701717
    1871 /*****************************************************************************
    1872  * Name      : BOOL GetNamedPipeHandleStateA
    1873  * Purpose   : The GetNamedPipeHandleStateA function retrieves information about
    1874  *             a specified named pipe. The information returned can vary during
    1875  *             the lifetime of an instance of the named pipe.
    1876  * Parameters: HANDLE  hNamedPipe           handle of named pipe
    1877  *             LPDWORD lpState              address of flags indicating pipe state
    1878  *             LPDWORD lpCurInstances       address of number of current pipe instances
    1879  *             LPDWORD lpMaxCollectionCount address of max. bytes before remote transmission
    1880  *             LPDWORD lpCollectDataTimeout address of max. time before remote transmission
    1881  *             LPTSTR  lpUserName           address of user name of client process
    1882  *             DWORD   nMaxUserNameSize     size, in characters, of user name buffer
    1883  * Variables :
    1884  * Result    : TRUE / FALSE
    1885  * Remark    :
    1886  * Status    : UNTESTED STUB
    1887  *
    1888  * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
    1889  *****************************************************************************/
    1890 
    1891 BOOL WIN32API GetNamedPipeHandleStateA(HANDLE  hNamedPipe,
    1892                                           LPDWORD lpState,
    1893                                           LPDWORD lpCurInstances,
    1894                                           LPDWORD lpMaxCollectionCount,
    1895                                           LPDWORD lpCollectDataTimeout,
    1896                                           LPTSTR  lpUserName,
    1897                                           DWORD   nMaxUserNameSize)
    1898 {
    1899   dprintf(("KERNEL32: GetNamedPipeHandleStateA(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented\n",
    1900            hNamedPipe,
    1901            lpState,
    1902            lpCurInstances,
    1903            lpMaxCollectionCount,
    1904            lpCollectDataTimeout,
    1905            lpUserName,
    1906            nMaxUserNameSize));
    1907 
    1908   return (FALSE);
    1909 }
    1910 
    1911 
    1912 /*****************************************************************************
    1913  * Name      : BOOL GetNamedPipeHandleStateW
    1914  * Purpose   : The GetNamedPipeHandleStateW function retrieves information about
    1915  *             a specified named pipe. The information returned can vary during
    1916  *             the lifetime of an instance of the named pipe.
    1917  * Parameters: HANDLE  hNamedPipe           handle of named pipe
    1918  *             LPDWORD lpState              address of flags indicating pipe state
    1919  *             LPDWORD lpCurInstances       address of number of current pipe instances
    1920  *             LPDWORD lpMaxCollectionCount address of max. bytes before remote transmission
    1921  *             LPDWORD lpCollectDataTimeout address of max. time before remote transmission
    1922  *             LPWSTR  lpUserName           address of user name of client process
    1923  *             DWORD   nMaxUserNameSize     size, in characters, of user name buffer
    1924  * Variables :
    1925  * Result    : TRUE / FALSE
    1926  * Remark    :
    1927  * Status    : UNTESTED STUB
    1928  *
    1929  * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
    1930  *****************************************************************************/
    1931 
    1932 BOOL WIN32API GetNamedPipeHandleStateW(HANDLE  hNamedPipe,
    1933                                           LPDWORD lpState,
    1934                                           LPDWORD lpCurInstances,
    1935                                           LPDWORD lpMaxCollectionCount,
    1936                                           LPDWORD lpCollectDataTimeout,
    1937                                           LPWSTR  lpUserName,
    1938                                           DWORD   nMaxUserNameSize)
    1939 {
    1940   dprintf(("KERNEL32: GetNamedPipeHandleStateW(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented\n",
    1941            hNamedPipe,
    1942            lpState,
    1943            lpCurInstances,
    1944            lpMaxCollectionCount,
    1945            lpCollectDataTimeout,
    1946            lpUserName,
    1947            nMaxUserNameSize));
    1948 
    1949   return (FALSE);
    1950 }
    1951 
    1952 
    1953 /*****************************************************************************
    1954  * Name      : BOOL GetNamedPipeInfo
    1955  * Purpose   : The GetNamedPipeInfo function retrieves information about the specified named pipe.
    1956  * Parameters: HANDLE  hNamedPipe      handle of named pipe
    1957  *             LPDWORD lpFlags         address of flags indicating type of pipe
    1958  *             LPDWORD lpOutBufferSize address of size, in bytes, of pipe's output buffer
    1959  *             LPDWORD lpInBufferSize  address of size, in bytes, of pipe's input buffer
    1960  *             LPDWORD lpMaxInstances  address of max. number of pipe instances
    1961  * Variables :
    1962  * Result    : TRUE / FALSE
    1963  * Remark    :
    1964  * Status    : UNTESTED STUB
    1965  *
    1966  * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
    1967  *****************************************************************************/
    1968 
    1969 BOOL WIN32API GetNamedPipeInfo(HANDLE  hNamedPipe,
    1970                                   LPDWORD lpFlags,
    1971                                   LPDWORD lpOutBufferSize,
    1972                                   LPDWORD lpInBufferSize,
    1973                                   LPDWORD lpMaxInstances)
    1974 {
    1975   dprintf(("KERNEL32: GetNamedPipeInfo(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented\n",
    1976            hNamedPipe,
    1977            lpFlags,
    1978            lpOutBufferSize,
    1979            lpInBufferSize,
    1980            lpMaxInstances));
    1981 
    1982   return (FALSE);
    1983 }
    1984 
    1985 
    19861718
    19871719/*****************************************************************************
     
    25382270
    25392271/*****************************************************************************
    2540  * Name      : BOOL SetNamedPipeHandleState
    2541  * Purpose   : The SetNamedPipeHandleState function sets the read mode and the
    2542  *             blocking mode of the specified named pipe. If the specified handle
    2543  *             is to the client end of a named pipe and if the named pipe server
    2544  *             process is on a remote computer, the function can also be used to
    2545  *             control local buffering.
    2546  * Parameters: HANDLE  hNamedPipe     handle of named pipe
    2547  *             LPDWORD lpdwMode       address of new pipe mode
    2548  *             LPDWORD lpcbMaxCollect address of max. bytes before remote transmission
    2549  *             LPDWORD lpdwCollectDataTimeout address of max. time before remote transmission
    2550  * Variables :
    2551  * Result    : TRUE / FALSE
    2552  * Remark    :
    2553  * Status    : UNTESTED STUB
    2554  *
    2555  * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
    2556  *****************************************************************************/
    2557 
    2558 BOOL WIN32API SetNamedPipeHandleState(HANDLE  hNamedPipe,
    2559                                          LPDWORD lpdwMode,
    2560                                          LPDWORD lpcbMaxCollect,
    2561                                          LPDWORD lpdwCollectDataTimeout)
    2562 {
    2563   dprintf(("KERNEL32: SetNamedPipeHandleState(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
    2564            hNamedPipe,
    2565            lpdwMode,
    2566            lpcbMaxCollect,
    2567            lpdwCollectDataTimeout));
    2568 
    2569   return (FALSE);
    2570 }
    2571 
    2572 /*****************************************************************************
    25732272 * Name      : BOOL SetSystemPowerState
    25742273 * Purpose   : The SetSystemPowerState function suspends the system by shutting
     
    27192418
    27202419
    2721 /*****************************************************************************
    2722  * Name      : DWORD TransactNamedPipe
    2723  * Purpose   : The TransactNamedPipe function combines into a single network
    2724  *             operation the functions that write a message to and read a
    2725  *             message from the specified named pipe.
    2726  * Parameters: HANDLE       hNamedPipe  handle of named pipe
    2727  *             LPVOID       lpvWriteBuf address of write buffer
    2728  *             DWORD        cbWriteBuf  size of the write buffer, in bytes
    2729  *             LPVOID       lpvReadBuf  address of read buffer
    2730  *             DWORD        cbReadBuf   size of read buffer, in bytes
    2731  *             LPDWORD      lpcbRead    address of variable for bytes actually read
    2732  *             LPOVERLAPPED lpo         address of overlapped structure
    2733  * Variables :
    2734  * Result    : TRUE / FALSE
    2735  * Remark    :
    2736  * Status    : UNTESTED STUB
    2737  *
    2738  * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
    2739  *****************************************************************************/
    2740 
    2741 DWORD WIN32API TransactNamedPipe(HANDLE       hNamedPipe,
    2742                                     LPVOID       lpvWriteBuf,
    2743                                     DWORD        cbWriteBuf,
    2744                                     LPVOID       lpvReadBuf,
    2745                                     DWORD        cbReadBuf,
    2746                                     LPDWORD      lpcbRead,
    2747                                     LPOVERLAPPED lpo)
    2748 {
    2749   dprintf(("KERNEL32: TransactNamedPipe(%08x,%08x,%08x,%08x,%08x,%08x,%08x) not implemented.\n",
    2750            hNamedPipe,
    2751            lpvWriteBuf,
    2752            cbWriteBuf,
    2753            lpvReadBuf,
    2754            cbReadBuf,
    2755            lpcbRead,
    2756            lpo));
    2757 
    2758   return (FALSE);
    2759 }
    2760 
    27612420
    27622421/*****************************************************************************
     
    28342493
    28352494/*****************************************************************************
    2836  * Name      : BOOL WaitNamedPipeA
    2837  * Purpose   : The WaitNamedPipe function waits until either a time-out interval
    2838  *             elapses or an instance of the specified named pipe is available
    2839  *             to be connected to (that is, the pipe's server process has a
    2840  *             pending ConnectNamedPipe operation on the pipe).
    2841  * Parameters: LPCTSTR lpszNamedPipeName
    2842  *             DWORD   dwTimeout
    2843  * Variables :
    2844  * Result    : TRUE / FALSE
    2845  * Remark    :
    2846  * Status    : UNTESTED STUB
    2847  *
    2848  * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
    2849  *****************************************************************************/
    2850 
    2851 BOOL WIN32API WaitNamedPipeA(LPCTSTR lpszNamedPipeName,
    2852                                 DWORD   dwTimeout)
    2853 {
    2854   dprintf(("KERNEL32: WaitNamedPipeA(%s, %u) not implemented.\n",
    2855            lpszNamedPipeName,
    2856            dwTimeout));
    2857 
    2858   return (FALSE);
    2859 }
    2860 
    2861 
    2862 /*****************************************************************************
    2863  * Name      : BOOL WaitNamedPipeW
    2864  * Purpose   : The WaitNamedPipe function waits until either a time-out interval
    2865  *             elapses or an instance of the specified named pipe is available
    2866  *             to be connected to (that is, the pipe's server process has a
    2867  *             pending ConnectNamedPipe operation on the pipe).
    2868  * Parameters: LPCWSTR lpszNamedPipeName
    2869  *             DWORD   dwTimeout
    2870  * Variables :
    2871  * Result    : TRUE / FALSE
    2872  * Remark    :
    2873  * Status    : UNTESTED STUB
    2874  *
    2875  * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
    2876  *****************************************************************************/
    2877 
    2878 BOOL WIN32API WaitNamedPipeW(LPCWSTR lpszNamedPipeName,
    2879                                 DWORD   dwTimeout)
    2880 {
    2881   dprintf(("KERNEL32: WaitNamedPipeW(%s, %u) not implemented.\n",
    2882            lpszNamedPipeName,
    2883            dwTimeout));
    2884 
    2885   return (FALSE);
    2886 }
    2887 
    2888 
    2889 
    2890 
    2891 /*****************************************************************************
    28922495 * Name      : BOOL WriteTapemark
    28932496 * Purpose   : The WriteTapemark function writes a specified number of filemarks,
Note: See TracChangeset for help on using the changeset viewer.