From 890ab1db44703abf206335837e3d9ee8d0e12b7b Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Wed, 30 Aug 2023 15:40:13 +0800 Subject: [PATCH] debug --- include/gdi.h | 15 ++++++++++++--- src/server/request.c | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/gdi.h b/include/gdi.h index 89337d90..728b2d3d 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -1772,7 +1772,7 @@ MG_EXPORT BOOL GUIAPI DestroySharedSurface (HSURF surf); /** * \fn int GUIAPI GetSharedSurfaceFDByClientWindow (int client, - * HWND hwnd) + * HWND hwnd, size_t *map_size, DWORD *flags) * \brief Gets the file descriptor of the shared surface of a window created * by another client. * @@ -1783,13 +1783,17 @@ MG_EXPORT BOOL GUIAPI DestroySharedSurface (HSURF surf); * * \param client The client identifier. * \param hwnd The handle to the window created by the client. + * \param map_size The pointer to a buffer of size_t to receive the whole size + * of the shared surface in bytes; nullable. + * \param flags The pointer to a buffer of DWORD to receive the flags of + * the shared surface; nullable. * * \return The file descriptor which represents the shared surface on success; * a value less than 0 for failure. * * \note This function only available when _MGSCHEMA_COMPOSITING is defined. * - * \sa CreateSharedSurface + * \sa AttachToSharedSurface, GetWindowSharedSurfaceFD * * Since 5.2.0 */ @@ -1797,7 +1801,8 @@ MG_EXPORT int GUIAPI GetSharedSurfaceFDByClientWindow (int client, HWND hwnd, size_t *map_size, DWORD *flags); /** - * \fn int GUIAPI GetSharedSurfaceFDByName (const char *name) + * \fn int GUIAPI GetSharedSurfaceFDByName (const char *name, + * size_t *map_size, DWORD *flags) * \brief Gets the file descriptor of a shared surface by name. * * This function gets the file descriptor of the shared surface created @@ -1806,6 +1811,10 @@ MG_EXPORT int GUIAPI GetSharedSurfaceFDByClientWindow (int client, * the shared surface. * * \param name The gobal unique name for the shared surface. + * \param map_size The pointer to a buffer of size_t to receive the whole size + * of the shared surface in bytes; nullable. + * \param flags The pointer to a buffer of DWORD to receive the flags of + * the shared surface; nullable. * * \return The file descriptor which represents the shared surface on success; * a value less than 0 for failure. diff --git a/src/server/request.c b/src/server/request.c index b6ada19a..1fe50784 100644 --- a/src/server/request.c +++ b/src/server/request.c @@ -55,6 +55,7 @@ #include +#define _DEBUG #include "common.h" #include "minigui.h" #include "gdi.h" @@ -831,6 +832,7 @@ int __mg_nssurf_map_operate_srv(const OPERATENSSURFINFO* req_info, switch (req_info->id_op) { case ID_NAMEDSSURFOP_REGISTER: + _DBG_PRINTF("Registering name: %s from client: %d\n", req_info->name, cli); entry = __mg_map_find(__nssurf_map, req_info->name); if (entry) goto done; @@ -849,6 +851,7 @@ int __mg_nssurf_map_operate_srv(const OPERATENSSURFINFO* req_info, } add_global_res(cli, __nssurf_map, entry->key, release_nssurf_info); + result = 0; break; case ID_NAMEDSSURFOP_SET: