current-window-configuration is a built-in function in `C source code'.

(current-window-configuration &optional FRAME)

Return an object representing the current window configuration of FRAME.
If FRAME is nil or omitted, use the selected frame.
This describes the number of windows, their sizes and current buffers,
and for each displayed buffer, where display starts, and the position of
point. An exception is made for point in the current buffer:
its value is -not- saved.
This also records the currently selected frame, and FRAME's focus
redirection (see `redirect-frame-focus'). The variable
`window-persistent-parameters' specifies which window parameters are
saved by this function.